Blob


1 /* 1-5 Modify the temperature conversion program to print the table in reverse order, that is, from 300 degrees to 0 */
3 #include <stdio.h>
5 /* print Fahrenheit-Celsius table
6 for fahr = 0, 20, ..., 300; floating-point version */
8 main()
9 {
10 float fahr;
12 printf("Fahr | Celsius\n");
13 printf("-----+--------\n");
14 for (fahr = 300; fahr >= 0; fahr -= 20) {
15 printf("%4.0f | %6.1f\n", fahr, (5.0/9.0) * (fahr - 32.0));
16 }
17 }