Need this program written in C code Not C or C Write a progr

Need this program written in C code. Not C+ or C++
Write a program to convert a temperature in degrees Fahrenheit to degrees Celsius. Date Requirements int Fahrenheit/* temperature in degrees Fahrenheit */double Celsius/* temperature in degrees Celsius */Celsius = 5/9 (Fahrenheit-32)

Solution

#include <stdio.h>

int main()
{
int Fahrenheit;
double Celsius;
printf(\"Enter the temperature in degree Fahrenheit: \");
scanf(\"%d\", &Fahrenheit);
Celsius = (5 * (Fahrenheit - 32)) / (double)9;
printf(\"Celsius = %lf\ \", Celsius);
  
return 0;
}

Output:

sh-4.2$ gcc -o main *.c                                                                                                                                                                                                                                                

sh-4.2$ main                                                                                                                                                                                                                                                           

Enter the temperature in degree Fahrenheit: 31                                                                                                                                                                                                                         

Celsius = -0.555556                                                                                                                                                                                                                                                    

sh-4.2$ gcc -o main *.c                                                                                                                                                                                                                                                

sh-4.2$ main                                                                                                                                                                                                                                                           

Enter the temperature in degree Fahrenheit: 50                                                                                                                                                                                                                         

Celsius = 10.000000

Need this program written in C code. Not C+ or C++ Write a program to convert a temperature in degrees Fahrenheit to degrees Celsius. Date Requirements int Fahr

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site