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
What’s a signal? Explain what do I use signals for?
How do you print only part of a string?
How do you write a program which produces its own source code as output?
How can I manipulate individual bits?
Explain the process of converting a Tree into a Binary Tree.
What is structure data type in c?
What is the deal on sprintf_s return value?
Write a C program to count the number of email on text
What is function prototype?
What is string length in c?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
What is the use of clrscr?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
I just typed in this program, and it is acting strangely. Can you see anything wrong with it?
Why should I use standard library functions instead of writing my own?