C LAB‎ > ‎(Sem1) Introduction to C‎ > ‎

WAP to convert temperature in Fahrenheit to Celsius.

posted Nov 6, 2010, 4:48 AM by Neil Mathew   [ updated Nov 10, 2010, 9:57 AM ]

SOURCE CODE:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>
 
int main()
{
 
 float Tf, Tc;
 
 printf("Enter temperature in Farenheit: ");
 scanf("%f", &Tf);
 
 Tc=((Tf-32)*(5.0/9.0));
 
 printf("The temperature in Celcius is %f", Tc);
 return 0;
}

OUTPUT:

 Enter temperature in Farenheit: 98.6
 The temperature in Celcius is 37.000000

Comments