- 4,650
- 39
Hi - what do I need to do to take a double value as input and display it? Thanks.
//This prints garbage:
#include <stdio.h>
int main(void)
{
double mydouble;
printf("Enter a number\n");
scanf("%f",&mydouble);
printf("you typed %f\n", mydouble);
return 0;
}
//This prints garbage:
#include <stdio.h>
int main(void)
{
double mydouble;
printf("Enter a number\n");
scanf("%f",&mydouble);
printf("you typed %f\n", mydouble);
return 0;
}