Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

ISRO | ISRO CS 2020 | Question 69

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

An array of 2 two byte integers is stored in big endian machine in byte address as shown below. What will be its storage pattern in little endian machine ?

Address Data
0 Ă— 104 78
0 Ă— 103 56
0 Ă— 102 34
0 Ă— 101 12 

(A)

0 Ă— 104 12
0 Ă— 103 56
0 Ă— 102 34
0 Ă— 101 78 

(B)

0 Ă— 104 12
0 Ă— 103 34
0 Ă— 102 56
0 Ă— 101 78 

(C)

0 Ă— 104 56
0 Ă— 103 78
0 Ă— 102 12
0 Ă— 101 34 

(D)

0 Ă— 104 56
0 Ă— 103 12
0 Ă— 102 78
0 Ă— 101 34 


Answer: (C)

Explanation: In little endian machines, last byte of binary representation of the multibyte data-type is stored first. On the other hand, in big endian machines, first byte of binary representation of the multibyte data-type is stored first.

Since, array of 2 two byte integers, so according to little endian,

0 Ă— 104 56
0 Ă— 103 78
0 Ă— 102 12
0 Ă— 101 34 

Option (C) is correct.

Quiz of this Question

My Personal Notes arrow_drop_up
Last Updated : 09 Sep, 2020
Like Article
Save Article
Similar Reads