How to calculate distance between two cities in a c program?
Solution
#include<stdio.h>
void main()
{
system("clear");
float x,m,ft,i,cm;
printf("enter the distance in km");
scanf("%f",&x);
m=x*1000;
cm=m*100;
i=cm*2.54;
ft=i*12;
printf("the distance in metre is %f \nin centimetre is %f \n in inches is %f \nin feet is %f",m,cm,i,ft);
}
Thanks & Regards,
Anju Soosan George
Assistant Professor
No comments:
Post a Comment