
Newbie: Trouble with scanf - HELP!!!
I had trouble with a code i was writing... the snippet i'm having
trouble with is the following:
int main(void)
{
double h, r;
printf("Enter the height and radius: ");
scanf("%f %f", &h, &r);
printf("%f %f\n", h, r);
return 0;
Quote:
}
It works with "int" variables (int h, r; and %d formats)
but it refuses to work with "double"...
I'm not getting an error but i do get junk as output.
someone help!
jim