GATE Computer ScienceHardGATE CSE · ISRO

An array int A[-2..3][4..9][1..5] (inclusive bounds, 4-byte ints) is stored in row-major order starting at byte address 1000. What is the byte address of A[1][7][3]?

  1. A. 1432
  2. B. 1420
  3. C. 1428
  4. D. 1272

Correct answer: C. 1428

Offset = ((1−(−2))·6 + (7−4))·5 + (3−1) = 107 elements, so address = 1000 + 4·107 = 1428.

More Programming and Data Structures (GATE) questions

Exams that ask this topic