Solve following problems Upload c file Write a C program tha
Solve following problems Upload *.c file Write a *C* program that will convert temperature from Fahrenheit to Celsius and display out screen #include int main(void) {double tempc;/* temperature in Celsius */double tempf;/* temperature in Fahrenheit */printf(\"Enter value of temp in Celsius: \"); scanf(\"%lf\", &tempc;); printf(\"\ Value of temp in Celsius: %if \ \", tempc); tempf = tempc = (9.0/5.0) + 32.0; printf (\"Temperature in Fahrenheit: %if \ \", tempf); return 0; /* execution terminates ok */}
Solution
below is the simple code for conversion of temperature from Fahrenheit to celsius :
#include <stdio.h>
int main()
{
double tempc; //temperature in celsius
double tempf; //temperature in fahrenheit
printf(\"Enter the value of temp in Fahrenheit: \ \");
scanf(\"%lf\", &tempf);
printf(\"value of temp in Fahrenheit is :%lf \ \",tempf);
tempc = 5.0 * (tempf - 32.0) / 9.0;
printf(\"Temperature in celsius : %lf\",tempc);
return 0;
}
