17. C Program to convert Kilometers into Meters and Centimeters.
How does this program work?
- The distance between Two cities is given by the user is stored in a variable.
- By using the formula we can get the distance in meters and centimeters.
- The output of the given question is here solved by using c language .
Here is the code
#include <stdio.h>
int main(void)
{
int a,b,c;
printf("Enter distance between two cities in km\n");
scanf("%d",&a);
b=a*1000; //To convert in meters
c=a*100000;//To convert in centimeters
printf("Total km in meters=%d\n",b );
printf("Total km in centimeters=%d",c );
return 0;
}