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 are the types of c language?

1044


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

2352


How to Throw some light on the splay trees?

1075


What is the difference between memcpy and memmove?

1049


What is the purpose of type declarations?

1125


What is a pointer in c?

1589


What are the advantages of Macro over function?

2038


What is the purpose of macro in C language?

1127


Why doesnt the call scanf work?

1204


What is "Hungarian Notation"?

1123


how to create duplicate link list using C???

2564


Explain how can you check to see whether a symbol is defined?

1214


Differentiate abs() function from fabs() function.

1028


Write the test cases for checking a variable having value in range -10.0 to +10.0?

2330


I have a varargs function which accepts a float parameter?

1062