aboutsummaryrefslogtreecommitdiff
path: root/1/5.c
blob: eb28376072fbca4581232b93b2ef4125f3341dcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
	Exercise 1-5. Modify the temperature conversion program to print the table in
	reverse order, that is, from 300 degrees to 0.
	===
*/

#include <stdio.h>

int main () {
	float fahr;
	for (fahr=300; fahr>=0; fahr-=20) {
		printf("%3.0f %6.1f\n", fahr, (5.0/9.0) * (fahr-32.0));
	}
}