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>
#include<conio.h>
void main(void)
{
int km;
long int meters, feet, inches, centimeters;
clrscr();
printf("Please enter distance between two cities: ");
scanf("%d", &km);
meters=km*1000;
feet=meters*3;
inches=feet*12;
centimeters=meters*100;
printf("\n\nMeters=%ld", meters);
printf("\nFeet=%ld", feet);
printf("\nInches=%ld", inches);
printf("\ncentimeters=%ld", centimeters);
getch();
}
thank you more program please
ReplyDelete