Write a C Program to Convert Temperature Given in Fahrenheit to Centigrade

In this tutorial learn how you can convert temperature given in Fahrenheit to Centigrade. Here are the conversion formulas of Fahrenheit to Centigrade.

Fahrenheit = Centigrade*1.8 + 32

C programming is a powerful general-purpose programming language. It can be used to develop software like operating systems, databases, compilers, etc.


write a c program to convert temperature given in fahrenheit to centigrade



Write a Program to Convert Temperature Given in Fahrenheit to Centigrade

Here is the code to convert the temperature given in Fahrenheit to Centigrade in C programming.

#include <stdio.h> //WAP to convert temperature given in Fahrenheit to Centigrade. [Hint: C*1.8 +32=F]
int main(){
float f,c;
printf("Enter temperature in Fahrenheit:");
scanf("%f",&f);
c=(f-32)/1.8;
printf("%f Fahrenheit equals to is:%f Centigrade.",f,c);
return 0;
}

Test Live At Jdoodle


Conclusion

This is how you can convert temperature given in Fahrenheit to Centigrade. Comment below if you like our tutorial.

Leave a Comment

Your email address will not be published. Required fields are marked *