6. Write a C program to enter length in centimeter and convert it into meter and kilometer.
Solution :-
#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
float centimeter,meter,kilometer;
printf("Enter the Length in Centimeter :-");
scanf("%f",¢imeter);
meter = centimeter/100.0;
kilometer = centimeter/100000.0;
printf("The Length in Meter is :-%f\n",meter);
printf("The Length in Kilometer is :-%f\n",kilometer);
getch();
}
Output :-