<<<...PROBLEM 1.2...>>>
The distance between two cities(in km.)is input through the keyboard.
Write a program to convert and print this distance in meters,feet,
inches and centimeters.
PROGRAM...
/*CONVERSION OF DISTANCE*/
#include<stdio.h>
int main()
{
float km,m,cm,ft,inch;
printf("\nEnter the distance in Kilometer:");
scanf("%f",$km);
m=km*1000;
cm=m*100;
inch=cm/2.54;
ft=inch/12;
printf("distance in meters=%f\n",m);
printf("distance in centimeters=%f\n",cm);
printf("distance in feet=%f\n",ft);
printf("distance in inch=%f\n",inch);
return 0;
}
OUTPUT=
Enter the distance in kilometers:3
Distance in meters=3000.000000
Distance in centimeter=300000.000
Distance in feet=9842.519531
Distance in inches=118110.234375
you can also read this post :.>>>>
0 Comments