repo.or.cz
/
letusc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
move to repo.or.cz
[letusc.git]
/
ch1
/
exercises
/
ex2.c
blob
3fa9f6c7b9a4d758ce1cd57ab74b09b7cba54ad4
1
/*distance problem*/
2
3
#include<stdio.h>
4
5
int
main
()
6
{
7
float
km
;
8
float
m
,
feet
,
inches
,
cm
;
9
10
printf
(
"Enter the distance in Km: "
);
11
scanf
(
"%f"
,&
km
);
12
13
m
=
km
*
1000
;
14
feet
=
3280.8399
*
km
;
15
inches
=
km
*
39370.0787
;
16
cm
=
m
*
100
;
17
18
printf
(
"m=%.2f
\n
"
,
m
);
19
printf
(
"feet=%.2f
\n
"
,
feet
);
20
printf
(
"inches=%.2f
\n
"
,
inches
);
21
printf
(
"cm=%.2f
\n
"
,
cm
);
22
return
0
;
23
}