Convert Centimeter to meter and kilometer.
- 1 meter = 100 centimeters
- 1 kilometer = 100000 centimeters
- Read the length in centimeters.
- use formulae and get the output.
- check the below code .
Program to Convert Centimeter to meter and kilometer
Input :
enter length in centimeters 100
Output :
100.0 centimeters = 1.0 meters.
100.0 centimeters = 1e-05 kilometers.
# program to convert centimeter to meter and kilometer
cm = float(input("enter length in centimeters "))
# centimeter to meter
meter = 0.01*cm
print(cm," centimeters = ",meter," meters.")
# centimeter to kilometer
km = 0.00001
print(cm," centimeters = ",km," kilometers.")
Output :
enter length in centimeters 100
100.0 centimeters = 1.0 meters.
100.0 centimeters = 1e-05 kilometers.
Comments
Post a Comment
Type Your Comments !
Please do not enter any spam link in the comment box.