The distance between two cities (in km) is input through the keyboard. Write a program to convert and print this distance in meters, feet, inches and centimeters. - Code With Friends

Breaking

Home Top Ad

Search Your Questions

Sunday, February 17, 2019

The distance between two cities (in km) is input through the keyboard. Write a program to convert and print this distance in meters, feet, inches and centimeters.

#include<stdio.h>
int main()
{
    int distance,meter,centimeter;
    printf("Enter the distance between two cities \n The distance must be whole number ");
    scanf("%d",&distance);

    meter=distance*1000;
    printf("The distance between two cities in meters is %d\n",meter);
    centimeter=distance*100000;
    printf("The distance between two cities in centimeter is %d\n",centimeter);


}




No comments:

Post a Comment