My Subject Blog

C Program Conversion of Distance

/* The distance between two cities (In KM) is input through keyboard. Write a program to convert and print this distance in meters, feet, inches & centimeters. */

#include <stdio.h>

int main(void) {
float km;
printf("Enter Length in KiloMeter : ");
scanf("%f",&km);
printf("\n %.2f KM = %.2f Meters",km,km*1000);
printf("\n %.2f KM = %.2f Feets",km,km*3280.84);
printf("\n %.2f KM = %.2f Inches",km,km*39370.08);
printf("\n %.2f KM = %.2f Centimeters",km,km*1000*100);
return 0;
}

Comments

Most Visited Post

C Program to Find Largest Odd Number from Array

Followers