finished exercise 1-5
[KandRexercises.git] / reversefahrc.c
blob1746a06482744e6bd7577d51c30cafb8de1790e7
1 #include <stdio.h>
2 /* exercise 1-5 */
3 /* print Fahrenheit-Celsius table
4 for fahr = 0, 20, ..., 300; floating-point version */
5 main()
6 {
8 int fahr;
10 printf("Fahr\tC\n");
11 for (fahr = 300; fahr > 0; fahr -= 20)
12 printf("%3.0d %6.1f\n", fahr, (fahr-32)*(5.0/9.0));