The distance between two cities (in km.) is input through the keyboard. Write a C program to convert and print this distance in meters, feet, inches and centimeters.
/* Conversion of distance */
float km, m, cm, ft, inch;
clrscr(); /* To clear the screen */
print(“\n Enter the distance in Milometers:”);
printf(“\nDistance in mters=%f”,m);
printf(“\nDistance in centimter=%f”,cm);
printf(“\nDistance in feet=%f”,ft);
printf(“\nDistance in inches=%f”,inch);
printf(“\n\n\n\n\n Press an key to exit….”);
getch(); /* To read a character from keyboard */
Please run this program and share the output with us.
For any query or issue, feel free to discuss on http://discuss.eduguru.in