C Program to Convert Kilometer to Millimeter

C program to convert kilometer to Millimeter: 

Formula: 1 km = 1000000 Millimeters

C Proogram to convert kilometers to Millimeter:
#include<stdio.h>
void main()
{
float km, Millimeteres;
printf("Enter the distance in kilometers = ");
scanf("%f",&km);
Millimeteres = km * 1000000;
printf("The Kilometers in Millimeters = %f",Millimeteres);
}
Output:
Enter the distance in kilometers = 1
The Kilometers in Millimeters = 1000000.000000
Explanation:
  • 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 * 1000000 is applied.
  • And last Prints the value of “meters".
See also:
Share:

Our Services

Search This Blog

  • ()
Powered by Blogger.

Alphabet Pattern (or) Character Pattern21 Program in C

Write "C"  Program to print below Alphabet Pattern21 (or) Character Pattern21: To underst...

Blog Archive