Q: Temperature of a City in Fahrenheit degree is input through the keyboard. Write a program to convert this temperature into centigrade degree.
#include<stdio.h>
int main()
{
float farn, centi; /*farn=temp in farenheit & centi=temp in centigrade*/
printf("Enter Temperature of city in Fahrenheit: ");
scanf("%f",&farn);
centi = (farn-32)*5/9;
printf("\n\nTemperature of city in Centigrade Degree: %f",centi);
return 0;
}
-----------------------------------------
output:
Enter Temperature of city in Fahrenheit: 67
Temperature of city in Centigrade Degree: 19.444445
Comments
Post a Comment