Tuesday, 30 June 2015

Program 4 : The distance between two cities (In KM) is input through key board. Write a program to convert and print this distance in meters, feet, inches & centimeters

#include<stdio.h>



void main() 

{

    int km;

    float meter, feet, cm, inches;

    printf("Enter the distance between two city");

    scanf("%d", &km);

    meter = km * 1000;

    feet = km * 3280;

    cm = km * 100000;

    inches = km * 39370;

    printf("km is :%d\n meter is:%f\n feet is:%f\n cm is:%f\n inches is:%f ", km, meter, feet, cm, inches);

    

}

No comments:

Post a Comment