C Program to Convert Kilometer to Meter

C program to convert kilometer to meter: 

Formula: 1 km = 1000 meters

C Proogram to convert kilometers to meter:
void main()
float km, meters;
printf("Enter the distance in kilometers = ");
meters = km * 1000;
printf("The Kilometers in meters = %f",meters);
Enter the distance in kilometers = 10
The Kilometers in meters = 10000.000000
  • Two variables km, meters are declared of type float.
  • The value of km is taken from keyboard given by the user.
  • And formula meters = km * 1000 is applied.
  • And last Prints the value of “meters".
See also:

Our Services

Search This Blog

  • ()
Powered by Blogger.

C Variables and Types of Variables in C

C variable is a data name that may be used to store a data value. The value of the C variable may get change in the program and it can be r...

Blog Archive