#include <stdio.h>
float FahrenheitToCelsius(float f);
int main(int argc, char **argv)
{
float temp_f, temp_c;
printf("Enter Temperature in Fahrenheit: ");
scanf("%f", &temp_f);
temp_c = FahrenheitToCelsius(temp_f);
printf("%.2f Fahrenheit = %.2f celsius\n",temp_f, temp_c);
return(0);
}
float FahrenheitToCelsius(float f)
{
float t;
t = (f - 32) / 1.8;
return(t);
}
/*
run1:
Enter Temperature in Fahrenheit: 1
1.00 Fahrenheit = -17.22 celsius
run2:
Enter Temperature in Fahrenheit: 50
50.00 Fahrenheit = 10.00 celsius
*/