K&R Exercises

Exercise 1-15: Temperature conversion function

Rewrite the temperature conversion program of Section 1.2 to use a function for conversion.

Print the same table as before, with printf("%3.0f %6.1f\n", fahr, celsius) for each row.

#include <stdio.h>

/* print Fahrenheit-Celsius table
   for fahr = 0, 20, ..., 300; floating-point version */
int main()
{
  /* your code goes here */

  return 0;
}

Test Cases

· space→ tab↵ newline

Submissions

No submissions yet