Saturday, 10 December 2011

Write a program to input the distance in kilometers and convert it in meter in c

#include
#include
main()
{
long int distkm,distmeter=0;
clrscr();
printf("Enter the distance in kilometers:-");
scanf("%ld",&distkm);
distmeter=distkm*1000;
printf("\n The distance in meters is:-%ld",distmeter);
getch();
}

OUTPUT
Enter the distance in kilometers:25
The distance in meters is: 25000

No comments:

Post a Comment