Q.Temperature of a city in
Fahrenheit degree is input through the keyboard. Write a program to convert
this temperature into Celsius.
Program:
#include<stdio.h>
#include<conio.h>
void
main()
{
float
F,C;
printf(“enter
temperature in fahrenheit=”);
scanf(“%f”,&F);
c=5.0/9*(f-32);
printf(\nThe
temperature in celcius is=%f”,C);
getch();
}
Output:
enter
temperature in Fahrenheit=40
The
temperature in celcius is=-40.000
No comments:
Post a Comment