Distance and Length Conversion Programs - C Program

Distance and Length Conversion Programs

#include<stdio.h>
 
int main() 
{
    int KM;
    float M,Feet, Inch;
    printf("Enter the Distance In KM :");
    scanf("%d",&KM);
    M = KM * 1000;
    Feet = M * 3.280;
    Inch = Feet * 12;
    printf("Distance in Meter :%f\n",M);
    printf("Distance in Feet :%f\n",Feet);
    printf("Distance in Inch :%f" ,Inch);
    
    return 0;
}

Output - Distance and Length Conversion Programs

Enter the Distance In KM :5                                                                                           

Distance in Meter :5000.000000                                                                                        
Distance in Feet :16400.000000                                                                                        
Distance in Inch :196800.000000 
Compile and Run Online