Blob


1 #include <stdio.h>
3 /* print Fahrenheit-Celsius table
4 for fahr = 0, 20, ..., 300 */
5 main() {
6 int fahr, celsius;
7 int lower, upper, step;
9 lower = 0; /* lower limit of temperature table */
10 upper = 300; /* upper limit */
11 step = 20; /* step size */
13 fahr = lower;
14 while (fahr <= upper) {
15 celsius = 5 * (fahr-32) / 9;
16 printf("%d\t%d\n", fahr, celsius);
17 fahr = fahr + step;
18 }
19 }