1 /* 1-3 Modify the temperature conversion program to print a heading above the table */
3 /* 1-4 write a program to print the corresponding celsius to Fahrenheit table */
7 /* print Fahrenheit-Celsius table
8 for fahr = 0, 20, ..., 300; floating-point version */
13 int lower, upper, step;
15 lower = 0; /* lower limit of temperature table */
16 upper = 300; /* upper limit */
17 step = 20; /* step size */
20 printf("Fahr | Celsius\n");
21 printf("-----+--------\n");
22 while (fahr <= upper) {
23 celsius = (5.0/9.0) * (fahr - 32.0);
24 printf("%4.0f | %6.1f\n", fahr, celsius);