Draw an algorithm to input distance between two cities (in km.) convert this distance in meters, feet, inches and centimeters.

Note:   1 kilometer = 1,000 meters, 1 meter = 3.28 feet, 1 foot = 12 inches, 1 inch = 2.54 centimeters.

  1. START
  2. Input Distance between two cities in Kilometer as Km.
  3. Convert the distance in Km into meter as meter= Km *1000.
  4. Convert the distance in meter into feet as feet = meter *3.28.
  5. Convert the distance in feet into inches as inch= feet *12.
  6. Convert the distance in inch into centimeter as cm= inch*2.54.
  7. Print the distance in meter,feet,feet,inch and cm.

8. End

Flowchart to input distance between two cities (in km.) convert this distance in meters, feet, inches and centimeters.

flowchart distance
flowchart distance

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.

Note:   1 kilometer = 1,000 meters,                            1 meter = 3.28 feet,

1 foot = 12 inches,                                          1 inch = 2.54 centimeters.

#include<stdio.h>
void main()
{
float km,meter,feet,inch,cm;
printf("Enter the distance between two city in kilometer :");
scanf("%f",&km);
meter=km*1000;
feet=meter*3.28;
inch=feet*12;
cm=inch*2.54;
printf("\nThe distance between two city in meter is :%.2f",meter);
printf("\nThe distance between two city in feet is :%.2f",feet);
printf("\nThe distance between two city in inches is :%.2f",inch);
printf("\nThe distance between two city in centimeters is :%.2f",cm);
}