c program to convert meter into centimeter,c program to convert to meters and centimeters,write a program in c convert km to m,unit convert program in c,meter and kilometer convert to centimeter,program in c to convert kilometer to meter,program for kilometers convert into meters and centimeters,write a program to convert kilometer to meter,how to convert centimeter into meter

 To convert length in centimeter we know about the relation between centimeter, meter and kilometer.

We have to enter the length in centimeter as input and we convert it to the meter and kilometer. So, let's get started.

Example
INPUT

Enter value in centimeter
5434

OUTPUT

Value in meter = 54.34
Value in kilometer = 0.05434

Knowledge Required

As for any program we must know the approach how to solve and what the knowledge required.

So, the required knowledge to convert centimeter into meter and kilometer are as follows:

First, relation between centimeter and meter:

     1 meter = 100 cm

Therefore, 

Divide the value by 100 , we get

    1 centimeter  = 0.01 meter

Second, relation between centimeter and kilometer

 1 kilometer = 1000 meter = 1,00,000 centimeter

Therefore, 

Divide the value by 100000 , we get

   1 centimeter = 0.000001 kilometer

Logic to solve code

1. Take value of centimeter as input

2. Perform the Operation as above explained

3. Finally print the values

Full Code to find the value in meter and kilometer from centimeter

/*  
  Program to convert centimeter into meter and kilometer  
  */  
   
  #include<stdio.h>  
   
  int main()  
  {  
   
   float cmeter, meter, kmeter;  
   
   // take the value of centimeter from user  
   printf("Enter the value in centimeter\n");  
   scanf("%f",&cmeter);  
   
   // Now Perform the program  
   meter = cmeter / 100;  
   // this gives value in meter  
   
   //Now perform kilometer program  
   kmeter = cmeter / 100000;  
   // this gives value in kilometer  
   
   //Now print all the values  
   printf("Value in meter = %.4f\n",meter);  
   
   printf("Value in kilometer = %.8f",kmeter);  
   
   return 0;  
   
   
  }  
   
   

\n is an escape sequence used to change the line;

%.5f means it takes values after decimal point by five.

Output
Enter the value in centimeter
5434


Value in meter = 54.3400
Value in kilometer = 0.05434000







We hope you will be able to understand the above code how to convert value in centimeter to the meter and kilometer. I wish you to please write this code on your own and run and see the result every time and looks your answer and you are always welcome to comment your answer in the comment box.

So, What's Your  Answer!  Write Here Below in the comment box!