]>
zdv2.bktei.com Git - BK-2023-05.git/blob - src/kr_exercises/ch1/s1.2/f_to_c_float.c
1 /* Desc: simple temperature converter
2 * Usage: ./s1..f_to_c_float.c
3 * Ref/Attrib: The C Programming Language, 2nd Edition, Section 1.2
9 /* print Fahrenheit-Celsius table for fahr = 0, 20, ..., 300 */
13 int lower
, upper
, step
;
15 lower
= 0; /* lower limit of temperature table */
16 upper
= 300; /* upper limit */
17 step
= 20; /* step size */
21 while (fahr
<= upper
){
22 celsius
= (5.0/9.0) * (fahr
-32.0);
23 printf("%3.0f,%6.1f\n", fahr
, celsius
);
28 printf("\n\nDone\n\n");
36 * Author: Steven Baltakatei Sandoval