/* fahrenheitCelsius.c - Copied from Kernighan and Ritchie
	I compile it with
		gcc -Wall -W fahrenheitCelsius.c
	and then run it with 
		a.out
	If I wanted to have a specific name, say table,
	for the executable file I would have said
		gcc -Wall -W -o table fahrenheitCelsius.c
	and then run with
		table
 */

#include <stdio.h>

/*
	Print Fahrenheit-Celsius table
	for fahr = 0, 20, .., 300 */

int main() {
    int fahr, celsius;
    int lower, upper, step;

    lower = 0;			/* lower limit of temperature table */
    upper = 300;		/* upper limit */
    step = 20;			/* step size */

    fahr = lower;
    while (fahr <= upper) {
	celsius = 5 * (fahr - 32) / 9;
	printf("%d\t%d\n", fahr, celsius);
	fahr = fahr + step;
    }

    return 0;
}

