Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main (void)
- {
- int quantidadeCasasDecimais;
- double num;
- printf("Digite um número real: ");
- scanf("%lf", &num);
- printf("Digite quantas casas decimais deseja: ");
- scanf("%d", &quantidadeCasasDecimais);
- printf("Valor: %.*f\n", quantidadeCasasDecimais, num);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement