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 / anuraag

Vasudhara's solution is correct!
Still here is an alternative solution to check endianess
without using pointers...

int main()
{
int x=0x58;
char ch;
ch=x;

if(ch=0x58)
printf("Little Endian");
else
printf("Big Endian");
return 0;
}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between structure and union in c programming?

1096


What is the ANSI C Standard?

1268


What are valid signatures for the Main function?

1223


What is the purpose of main( ) in c language?

1132


What are c header files?

988


What is the difference between functions abs() and fabs()?

1149


In a switch statement, explain what will happen if a break statement is omitted?

1065


List some of the dynamic data structures in C?

1238


Is there any possibility to create customized header file with c programming language?

1062


What is character constants?

1178


Explain about block scope in c?

1089


Write a program to check whether a number is prime or not using c?

1054


What is structure pointer in c?

1046


What is a function in c?

1573


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

2316