GATE Computer ScienceModerateGATE CS (PYQ pattern)

An array A[1..4], [0..5], [1..6] of 8-byte elements is stored in row-major order starting at address 500. What is the address of A[3][2][5]?

  1. A. 1500
  2. B. 1204
  3. C. 1348
  4. D. 1108

Correct answer: B. 1204

Dimension sizes are [4, 6, 6]; the offset is built Horner-style from (index − lower bound), then × 8, giving 1204. Forgetting the lower bounds or swapping the layout order gives the distractors.

More Compiler Design questions

Exams that ask this topic