repo.or.cz
/
KandRexercises.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
finished exercise 1-5
[KandRexercises.git]
/
reversefahrc.c
blob
1746a06482744e6bd7577d51c30cafb8de1790e7
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
{
7
8
int
fahr
;
9
10
printf
(
"Fahr
\t
C
\n
"
);
11
for
(
fahr
=
300
;
fahr
>
0
;
fahr
-=
20
)
12
printf
(
"%3.0d %6.1f
\n
"
,
fahr
, (
fahr
-
32
)*(
5.0
/
9.0
));
13
14
}