//find the idstance between two buildings in different ways
#include "stdio.h"
int main (){
float km,cm,feet,mtr,ich;
printf ("The distance between two cityies is :\n");
scanf ("%f",&km);
mtr=km*1000; //for meter
printf ("The distance (in meter ) between two cityies is %f\n ",mtr);
cm=mtr*100; //for cm
printf ("The distance (in centimeter ) between two cityies is %f\n ",cm);
ich=cm/2.54; //in inch
printf ("The distance (in inch) between two cityies is %f\n ",ich);
feet=ich/12; //in feet
printf ("The distance (in feet ) between two cityies is %f\n ",feet);
return 0;
}
output output output
The distance between two cityies is :
1
The distance (in meter ) between two cityies is 1000.000000
The distance (in centimeter ) between two cityies is 100000.000000
The distance (in inch) between two cityies is 39370.078125
The distance (in feet ) between two cityies is 3280.839844
No comments:
Post a Comment