The distance between two cities (in km.) is input through through the keyboard .Write a program to convert and print this distance in meters , feet , inches , and centimeters.


 #include<stdio.h>
void main()
{
float km,meter,feet,inch,cm;

    printf("Enter a distance in km=");
    scanf("%f",&km);
    
    meter=1000*km;
    feet=3281*km;
    inch=39370*km;
    cm=100000*km;
    printf("\n meter:%f",meter);
    printf("\n cm:%f",cm);
    printf("\n feet:%f",feet);
    printf("\n inch:%f",inch);
    
}
Post a Comment (0)
Previous Post Next Post