summaryrefslogtreecommitdiff
path: root/weather.c
blob: 114c681b49d0c87286e9f1e9eb906f9a62f7f718 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <math.h>


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

	lower = 0;      /* lower limit of temperature scale */
	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;
	}
}