Distance between two cities

Write a program to calculate the distance between two cities.Take distance in Kilometers and convert them into Meter,Centimeter,Milimeter,Inches and Feets.

#include


#include

void conversion(void);

void main(void)

{

clrscr();

conversion();

getch();

}

void conversion(void)

{

float h=1,s=1,a,d=1,f=1,g=1;

printf("Enter Distance in Kilometer:");

scanf("%f",&a);

d=a*1000;

printf("The Distance between two Cities in Meters is %.2fm",d);

s=a*3280.8;

printf("\nThe Distance between two Cities in Feets is %.2ffts",s);

f=a*39370.07;

printf("\nThe Distance between two Cities in Inches is %.2finches",f);

g=a*100000;

printf("\nThe Distance between two Cities in Centimeters is %.2fcms",g);

h=a*1000000;

printf("\nThe Distance between two Cities in Milimeters is %.2fmm",h);

}

Comments

Popular posts from this blog

Tip of the Day # 13

Governor Generals of Pakistan