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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c basic?

1148


What is 2c dna?

1042


What is file in c preprocessor?

1108


What is array of structure in c?

1131


why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above

1113


.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }

2540


Explain what is meant by 'bit masking'?

1163


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1067


Explain the difference between call by value and call by reference in c language?

1080


What is a spanning Tree?

1537


Are negative numbers true in c?

1029


Which header file is used for clrscr?

1030


What is the return type of sizeof?

1045


What is the meaning of 2d in c?

1085


What is an expression?

1023