DISTANCE BETWEEN TWO CITIES - C PROGRAMMING - Code Developer Pro

Breaking

Code Developer Pro

Solutions to all coding problems

Like us on Facebook

test banner

Post Top Ad

Responsive Ads Here

Post Top Ad

Responsive Ads Here

Thursday, 17 December 2015

DISTANCE BETWEEN TWO CITIES - C PROGRAMMING

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

Post Top Ad

Responsive Ads Here