C = (f-32)/1.8.
f = 1.8 * C + 32.
C Program To Convert Temperature From Fahrenheit To Celsius
#include<stdio.h>
#include<conio.h>
void main()
{
float celsius, fahrenheit;
clrscr();
printf("\n Enter Temp in Fahrenheit : ");
scanf("%f", &fahrenheit);
celsius = (fahrenheit-32) / 1.8;
printf("\n Temperature in Celsius : %.2f ", celsius);
getch();
}
Output :
Temperature Conversion From Celsius to Fahrenheit C Program
#include<stdio.h>
#include<conio.h>
void main()
{
float celsius, fahrenheit;
clrscr();
printf("\n Enter Temp in Celsius : ");
scanf("%f", &celsius);
fahrenheit = (1.8 * celsius) + 32;
printf("\n Temperature in Fahrenheit : %.2f ", fahrenheit);
getch();
}
Output :
In this way we can easily convert temperature from fahrenheit to celsius and vice versa.
