Search This Blog

Translate

C program to Accept distance in kilometer and convert it into meter,centimeter ,feet , inches

C program to Accept distance in kilometer and convert it into meter,centimeter ,feet , inches 


#include
#include
void main()
{
int km;
long meter,cm;
float feet,inch;
clrscr();
printf("\nEnter the distance in KiloMeter=");
scanf("%d",&km);
meter=km*1000;
printf("\n\nDistance in Meter is=%ld",meter);
cm=meter*100;
printf("\n\nDistance in Centimeter is=%ld",cm);
inch=cm/2.54;
printf("\n\nDistance in Inch is=%f",inch);
feet=inch/12;
printf("\n\nDistance in Feet is=%f",feet);
getch();
}


C program to Accept distance in kilometer and convert it into meter,centimeter ,feet , inches 

C Program example List

Google+ Badge