C Program to Convert Fahrenheit to Celsius

In this tutorial, we will write a C Program to convert Fahrenheit into Celsius. Let us start by understanding the formula for the conversion of Fahrenheit into Celsius.

Fahrenheit and Celsius, both are the unit for measuring the temperature. Fahrenheit is represented by oF and Celsius by oC.

Formula to convert Fahrenheit into Celsius

celsius = (fahrenheit – 32)*5/9


C ProgrC Program to Convert Temperature from Fahrenheit to Celsius

#include<stdio.h>
 
void main()
{
    float c,f;
 
    //user input
    printf("Enter the Fahrenheit value: ");
    scanf("%f",&f);
 
    //conversion
    c = (f - 32) * 5 / 9;
    
    //Display the result
    printf("Celsius: %.3f", c); 
}

Output:

Enter the Fahrenheit value: 64
Celsius: 17.778