C Program to Convert Kilometer (km) to Meter (m)

Kilometer is a unit of length in international system of units. It is denoted by km.

1km is equivalent to 1000 meters. So, to convert kilometer to meter; we need to multiply the length value in kilometer by 1000.

This C program converts value given in kilometer to meter.

C Source Code: Kilometer to Meter


#include<stdio.h>

int main()
{
 float km, m;

 printf("Enter distance in kilometer: ");
 scanf("%f", &km);

 m = km * 1000;

 printf("%0.3f Kilometer = %0.3f Meter", km, m);

 return 0;
}

Output

The output of the above program is:

Enter distance in kilometer: 5.436
5.436 Kilometer = 5436.000 Meter