convert-program.jpg

C Program to Convert Kilometer into Centimeter, Meter, Inch, Feet.

C Program to Convert Kilometers into Centimeters, Meter, Inch, Feet. 


As you read in the title, this program is based to convert kilometers into cm, m, inch, feet, etc.

In this program, we use the float data type instead of the integer data type because we don't know the number entered by the user is an integer or a decimal number. so we've to take our safety...

After it, we applied the formulas of the conversion of km to cm, inch, m, feet.

Fun Fact: - If you don't know the formula, just Google it. ðŸ˜‰ðŸ˜Š.

Source Code 
#include <stdio.h>
int main()
{
float km,m,f,in,cm;
    printf("\nEnter the distance in KM: ");
    scanf("%f",&km);
    m=km*1000;
    f=km*3.3;
    in=km*39;
    cm=km*180;
    printf("\n\nDISTANCE IN METERS:%f",m);
    printf("\nDISTANCE IN FEET:%f",f);
    printf("\nDISTANCE IN INCHES:%f",in);
    printf("\nDISTANCE IN CENTIMETER:%f",cm);
return 0;
}

Output:-