11.5k views
4 votes
Write a program named fahrenheittocelsius that accepts a temperature in fahrenheit from a user and converts it to celsius by subtracting 32 from the fahrenheit value and multiplying the result by 5/9. display both values to one decimal place.

User Waveter
by
5.9k points

1 Answer

6 votes
float f;
scanf(" %f",&f);
printf("%.1f F %.1f C\\", f,(f-32)*5./9.);

User Sitz Blogz
by
5.1k points