Fahrenheit to Celsius in C
Here, you will get example code to convert Fahrenheit to Celsius in c program. Formula to convert Fahrenheit to Celsius is the following:
Fahrenheit to Celsius formula
Celsius = (Fahrenheit – 32) * (5/9)
100 Fahrenheit to Celsius
Result=(100°F − 32) × 5/9
= 37.778°C
Convert Fahrenheit to Celsius in C program
1 2 3 4 5 6 7 8 9 10 | #include <stdio.h> int main() { float fahrenheit, celsius; printf("Input temperature in Fahrenheit: "); scanf("%f", &fahrenheit); celsius = (fahrenheit - 32) * 5/9; printf("%.2f Fahrenheit = %.2f Celsius\n", fahrenheit, celsius); return 0; } |
Output
Input temperature in Fahrenheit: 102
102.00 Fahrenheit = 38.89 Celsius
Check out our other C programming Examples