Interview Questions and Answers :: NEC Technologies
Home > Experience Archives > NEC Technologies > Interview Question Set 2 > Discussion
11. Write a program to find machine is little endian or big endian
Answer:
int i=1;
if ((*(char*)&i) == 1)
printf("LE");
else
printf("BE");
Ramya
24 Aug, 2018 12:03 PM
int i=1;
if ((*(char*)&i) == 1)
printf("LE");
else
printf("BE");
if ((*(char*)&i) == 1)
printf("LE");
else
printf("BE");
Report Error
Report Error
Please Login First Click Here