Exercise: Fahrenheit to Celsius

Write code to solve the problem.

Question

Complete the function degF_to_degC(), which converts a temperature in degrees Fahrenheit to degrees Celsius using the following formula:

C=(F−32)1.8C=\frac{(F-32)}{1.8}

The function receives the temperature in degrees Fahrenheit in the parameter degF. Store the converted value in degC and return it. Then, in main(), call the function with 4.3 and print the result using printf("%f\n", ...).

Example

Input:  degF_to_degC(4.3)
Output: -15.388889

Try solving it here:

Exercise: Fahrenheit to Celsius

Write code to solve the problem.

Question

Complete the function degF_to_degC(), which converts a temperature in degrees Fahrenheit to degrees Celsius using the following formula:

C=(F−32)1.8C=\frac{(F-32)}{1.8}

The function receives the temperature in degrees Fahrenheit in the parameter degF. Store the converted value in degC and return it. Then, in main(), call the function with 4.3 and print the result using printf("%f\n", ...).

Example

Input:  degF_to_degC(4.3)
Output: -15.388889

Try solving it here:

C
#include <stdio.h>
double degF_to_degC(double degF)
{
double degC;
// Write your code below and put your conversion in degC
return degC;
}
int main()
{
// Call degF_to_degC() with 4.3 and print the result using printf("%f\n", ...)
return 0;
}