/* Modify the temperature conversion program to print the table in reverse order, that is, from 300 degrees to 0. */ #include <stdio.h> /* print Fahrenheit-Celsius table in reverse order */ main() { int fahr; for(fahr = 300; fahr >= 0; fahr -= 20) { printf("%3d %6.1f\n", fahr, (5.0 / 9.0) * (fahr - 32)); } } /* Output: 300 148.9 280 137.8 260 126.7 240 115.6 220 104.4 200 93.3 180 82.2 160 71.1 140 60.0 120 48.9 100 37.8 80 26.7 60 15.6 40 4.4 20 -6.7 0 -17.8 Press any key to continue . . . */
C - The C Answer (2nd Edition) - Exercise 1-5
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
C++基础2
构造函数和析构函数构造函数
构造函数 析构函数 -
C语言学习2
第二天
操作符 数组 字符串 -
51c视觉~合集5AI