Correct Answer - Option 3 :
0 × 104 56
0 × 103 78
0 × 102 12
0 × 101 34
Concept -
- Little and big endian are two ways of storing multi-byte data-types like int, float, etc.
- In little endian machines, last byte of binary representation of the multi-byte data-type is stored first.
- On the other hand, in big endian machines, first byte of binary representation of the multi-byte data-type is stored first.
Explanation -
Given in the question is that each integer is of two bytes. For little endian-big endian, we will determine MSB and LSB of both the integers.
The big endian format,
104
|
103
|
102
|
101
|
78
|
56
|
34
|
12
|
MSB-1
|
LSB-1
|
MSB-2
|
LSB-2
|
MSB-1 refers to MSB of 1st integer.
For little endian, we simply have to reverse the exchange MSB with LSB and vice versa.
104
|
103
|
102
|
101
|
56
|
78
|
12
|
78
|
LSB-1
|
MSB-1
|
LSB-2
|
MSB-2
|
Hence, Option 3 is correct.
NOTE
if this was one integer with 4 bytes, then in little endian format, entire sequence would have been reversed.