#include
/* Program to converts value entered in Km to inches,
centimetres, feet and metres In C. */
main()
{
float km,m,cm,inch,foot;
printf("Enter the distance between the two cities in Km: ");
scanf("%f", &km);
inch = 39370*km;
foot = 3281*km;
cm= 100000*km;
m = 1000*km;
printf ("\n Distance converted to inches: %f", inch);
printf ("\n Distance converted to feet: %f", foot);
printf ("\n Distance converted to centimeters: %f", cm);
printf ("\n Distance converted to meters: %f", m);
}
No comments:
Post a Comment