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...

Write a small C program to determine whether a machine's
type is little-endian or big-endian.

Answer Posted / vasundhara

int main()
{
int x=1;

if(*(char*)&x)
printf("little endian");
else
printf("big endian");

return 0;
}

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

1981


What is void c?

1109


Differentiate between #include<...> and #include '...'

1068


Can you mix old-style and new-style function syntax?

1106


What is %s and %d in c?

1050


What is pass by value in c?

1077


What are the different types of linkage exist in c?

1035


What is the difference between array_name and &array_name?

1310


How can I determine whether a machines byte order is big-endian or little-endian?

1067


To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9

2644


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

1117


Which is better oop or procedural?

1083


Explain #pragma statements.

1060


Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?

1512


Subtract Two Number Without Using Subtraction Operator

859