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
C language questions for civil engineering
What is structure packing in c?
What is break statement?
2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier. Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed. When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed. Sequence of take-off is the sequence of addition to the waitlist
What should malloc(0) do?
What are the advantages of using Unions?
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
What is the significance of an algorithm to C programming?
Can we change the value of #define in c?
How is actual parameter different from the formal parameter?
Why void is used in c?
What do you mean by scope of a variable in c?
Where are some collections of useful code fragments and examples?
What does s c mean in text?
Describe newline escape sequence with a sample program?