Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to correct this C language? Kneel down and ask the big cows for advice
How to correct this C language? Kneel down and ask the big cows for advice
# include"stdio.h"

# include"math.h"

void main()

{

float f,c;

printf ("Please enter Fahrenheit \n");

scanf("%f",& f); (You were originally %d here, which is wrong)

c=(float)5/9*(f-32); (5 should be defined as single precision, otherwise the result of 5/9 is only shaped, and it will be )

printf ("Celsius temperature is %f\n",c);

system("pause");

}

Pure hand-beating, I hope to adopt it (* _ _ *).