K&R Exercises

Exercise 1-5: Temperature table in reverse

Modify the temperature conversion program to print the table in reverse order, that is, from 300 degrees to 0.

Use the "for" loop version of the program, and print each row with printf("%3d %6.1f\n", fahr, (5.0/9.0)*(fahr-32)).

#include <stdio.h>

/* print Fahrenheit-Celsius table; "for" loop version */
int main()
{
  /* your code goes here */

  return 0;
}

Test Cases

· space→ tab↵ newline

Submissions

No submissions yet