3. Write a C program to input temperature in degree Fahrenheit and convert it to degree Centigrade.
Example:
Input
Temperature in fahrenheit = 205
Output
Temperature in celsius = 96.11 C
Solution:
#include<stdio.h>
int main()
{
double celsius,fahrenheit;
printf("Temperature in fahrenheit = ");
scanf("%lf",&fahrenheit);
celsius = (fahrenheit - 32)/1.8;
printf("Temperature in celsius = %0.2lf C\n",celsius);
return 0;
}
Post a Comment
0Comments