move to repo.or.cz
[letusc.git] / ch1 / exercises / ex2.c
blob3fa9f6c7b9a4d758ce1cd57ab74b09b7cba54ad4
1 /*distance problem*/
3 #include<stdio.h>
5 int main()
7 float km;
8 float m,feet,inches,cm;
10 printf("Enter the distance in Km: ");
11 scanf("%f",&km);
13 m=km*1000;
14 feet = 3280.8399*km;
15 inches = km * 39370.0787;
16 cm = m *100;
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;