HTML Tutorial || Networking Assignment || Computer Full Forms || Ms-Office Shortcut Keys || Ms-Office Notes || Number System Notes || Internet Assignment
JavaScript Tutorial || CSS Tutorial || Operating System Notes || History of Computer Assignment || Netwoking Notes || Computer Fundamentals Notes

C Program to Enter Length in Centimeter and Convert it into Meter and Kilometer ?


Q:- Write a C Program to Enter Length in Centimeter and it into Meter and Kilometer ?
 Input
#include<stdio.h>
#include<conio.h>
int main()
{
float m,cm,km;
printf(“Enter Length in Centimeter=”);
scanf(“%f”,cm);
m=cm /100.0;
km=cm /100000.0;
printf(“Length in Meter=%.2f\n”m);
printf(“Length in Kilometer=%.2f\n”,km);
getch();
}

Output
Enter Length in Centimeter = 1000
Length in Meter = 10.00 m
Length in Kilometer = 0.01 km

Comments