Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


5. distance conversion:
Convert a distance from miles to kilometers .there are 5280
feets per mile,12 inches per foot .2.54 centimeters per
inch and 100000centimeters per kilometer

Answers were Sorted based on User's Feedback



5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mil..

Answer / gayathri

include<stdio.h>
void main()
{
int miles;
double inch,feet;
long cm,km;

printf("Enter how many miles");
scanf("%d",&miles);

feet=5280*miles;
inch=feet*12;
cm=inch*2.54;
km=(cm/100000);
printf("Distance in KM:%lf"+km);

}

I did not compile the program,i wrote it directly
If there are any errors please specify........

Is This Answer Correct ?    2 Yes 1 No

5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mil..

Answer / gayathri

There is Syntax error
Line 15: printf("Distance in KM: %lf",km);

Is This Answer Correct ?    0 Yes 0 No

5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mil..

Answer / sindhu

#include<stdio.h>
#include<conio.h>
main()
{
double km,mile;
printf(" enter distance in miles");
scanf("%f",&mile);
km=5280*12*2.54*100000*mile;
printf("
distance in km is %f",km);
getch();
}

Is This Answer Correct ?    0 Yes 0 No

5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mil..

Answer / yogesh bansal

#include <stdio.h>
#define FEETS 5280
#define INCH 12
#define CENTIMETER 2.54
#define CMPERKM 100000
int main()
{
unsigned int miles=0;
unsigned feets;
unsigned inches;
double centimeter;
double KM;
printf("please enter the distance in miles\n");
scanf("%u",&miles);
feets = miles * FEETS;
printf("the distance in feets %u\n",feets);
inches = feets * INCH;
printf("the distance in inches %u\n",inches);
centimeter = inches * CENTIMETER;
printf("the distance in centimeter %fd\n",centimeter);
KM = centimeter/CMPERKM;
printf("the distance in KM %fd\n",KM);
return 0;
}

Is This Answer Correct ?    3 Yes 4 No

Post New Answer

More C Interview Questions

What will the code below print when it is executed?   int x = 3, y = 4;         if (x = 4)                 y = 5;         else                 y = 2;         printf ("x=%d, y=%d ",x,y);

0 Answers  


Add Two Numbers Without Using the Addition Operator

0 Answers  


What Is The Difference Between Null And Void Pointer?

0 Answers   TCS,


write a c programs to do multiplication of two numbers with out using arithmatic operator ??????????

7 Answers   Infosys, TCS,


What is floating point exception error? And what are different types of errors occur during compile time and run time? why they occur?

1 Answers  


How can I find the modification date and time of a file?

0 Answers  


How is pointer initialized in c?

0 Answers  


Concat two string with most overlapped substring has to removeĀ  "abcd"+ "cdef" = "abcdef

6 Answers  


Write a program to generate the first n terms in the series --- 2,3,5,7,11,...,17

0 Answers  


How to add two numbers without using arithmetic operators?

18 Answers   College School Exams Tests, e track, Infosys, Pan Parag, Sapient, TCS,


Explain continue keyword in c

0 Answers  


List some of the static data structures in C?

0 Answers  


Categories