 # Answered! Could you write a code for this in C language? Please explain youre code in comments so its easy to understand. Please also attach a picture of your code. Thanks…

Could you write a code for this in C language? Please explain youre code in comments so its easy to understand. Please also attach a picture of your code. Thanks

. Write a program to convert a temperature in degrees Fahrenheit to degrees Celsius. DATA REQUIREMENTS

Don't use plagiarized sources. Get Your Custom Essay on
Answered! Could you write a code for this in C language? Please explain youre code in comments so its easy to understand. Please also attach a picture of your code. Thanks…
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS \$13/PAGE

Problem Input

int fahrenheit /* temperature in degrees Fahrenheit */

Problem Output

double celsius /* temperature in degrees Celsius */

Relevant Formula

celsius = 5/9 ( fahrenheit − 32) A sample of program output is displayed below

____End of Assignment __________________________________________________________

/* A C program to convert a temperature in degrees Fahrenheit to degrees Celsius.*/

#include <stdio.h>

int main()
{
/* Declare the necessary variables */
int fahrenheit; /* input variable to store temperature in degrees Fahrenheit */
double celsius; /* output variable where resultant temperature will be stored in degrees Celsius */

/* input is taken from user*/
/*as specified in question input should be Integer type of data*/
printf(“nEnter temperature in Fahrenheit(Integer Number): “);
scanf(“%d”, &fahrenheit);

/* Fahrenheit to celsius conversion formula is used : celsius = 5/9 ( fahrenheit – 32) */
celsius =(double)5/9*(fahrenheit – 32) ; /* as the output variable is double,so we have to use explicit casting for integer division 5/9 */

/* Print the output result*/
printf(“n%d Fahrenheit(in degree) = %f Celsius(in degree)”, fahrenheit, celsius);/* output will print fractional values up to six decimal places*/

return 0;
}

/* picture of code*/ /* pictures of outputs:*/   