GATE CS 1998 · Arrays & Matrix Representation

MCQ · 1 mark · Problem PROG-DSTR-0256

Let A be a two dimensional array declared as follows:A: array [1 ... 10] [1 ... 15] of integer; Assuming that each integer takes one memory location, the array is stored in row-major order and the first element of the array is stored at location 100, what is the address of the element A[i][j]?
  1. A
    15i+j+84
  2. B
    15j+i+84
  3. C
    10i+j+89
  4. D
    10j+i+89

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionOfficial GATE Answer Key: Option A.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/1686/gate1998-2-14

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com