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
What is the time and space complexities of merge sort and when is it preferred over quick sort?
What are pragmas and what are they good for?
What is modeling?
Should I learn data structures in c or python?
Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.
What is "Hungarian Notation"?
What is #include called?
What is the use of function in c?
What is non linear data structure in c?
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
Describe the steps to insert data into a singly linked list.
What does the function toupper() do?
Are there constructors in c?
write a program to copy the string using switch case?
When should volatile modifier be used?