diff options
Diffstat (limited to 'ch01/ex05-temp.c')
| -rw-r--r-- | ch01/ex05-temp.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ch01/ex05-temp.c b/ch01/ex05-temp.c new file mode 100644 index 0000000..6af87c6 --- /dev/null +++ b/ch01/ex05-temp.c @@ -0,0 +1,11 @@ +#include <stdio.h> + +/* print Fahrenheit-Celsius table, in reverse order */ +int main() +{ + int fahr; + + for (fahr = 300; fahr >= 0; fahr = fahr - 20) { + printf("%3d %6.1f\n", fahr, (5.0/9.0)*(fahr-32)); + } +} |
