a function celsius() to convert degrees Fahrenheit to degrees Celsius. Use it to print a Fahrenheit-to-Centigrade table for -40 to 220 degrees Fahrenh

Here is the function:

double celsius(double f)
{
return 5. / 9. * (f - 32);
}
Here is the driver program:
#include 

double celsius(double);

int main()
{
double f;

for(f = -40; f <= 220; f = f + 10)
printf("%f\t%f\n", f, celsius(f));

return 0;
}

No comments:

Post a Comment