Javatpoint Logo
Javatpoint Logo

Program to Convert Kilometer to cm

Here, we will learn how to convert the length value, which is given in Kilometer, to the length in centimeter.

If we want to convert the value of Kilometer into cm value, then we have to use the following formula:

1 km = 100000 cm. cm = 100000 * Kilometer.

Program 1: Write a Program in C for converting the length value of Kilometer into centimeter.

Output:

Value of 4 kilometer in Centimeter is: 400000

Program 2: Write a Program in PHP for converting the value of Kilometer into cm.

Output:

Value of 10.4 Kilometer in Centimeter is: 1040000

Program 3: Write a Program in Java for converting the value of Kilometer into cm.

Output:

Value in Centimeter is: 200845.70

Program 4: Write a Program in Python for converting the value of Kilometer into cm.

Output:

Enter the length in Kilometer: 25
The length in centimeter 2500000.00

Next TopicPort Forwarding




Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA