C Programming: Write a statement that reads a floating point (real) value...

  • Thread starter Thread starter twanx
  • Start date Start date
T

twanx

Guest
...from standard input into...? Write a statement that reads a floating point (real) value from standard input into temperature. Assume that temperature. has already been declared as an double variable.

So far, I wrote:

scanf("%f", &temperature);

but it's not right according to my online homework. The correction says that the %f part is not right. I tried %d and it didn't work either. Any clues?

Thanks.
 
u need %lf for double and a space between the double quote and your placeholder when working with scanf.

scanf(" %lf", &temperature);

i have the same problem for my hw.
 
Back
Top