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 is the general form of #line preprocessor?
What is the newline escape sequence?
What does do in c?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
What is the difference between exit() and _exit() function?
Why main function is special give two reasons?
What is a static function in c?
What is logical error?
How is actual parameter different from the formal parameter?
Why array is used in c?
What are structure members?
ATM machine and railway reservation class/object diagram
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
Where we use clrscr in c?
What is the difference between arrays and pointers?