Consider an array A[20, 10], assume 4 words per memory cell and the base address of array A is 100. What is the address of A [11, 5]? Assume row major storage.
Show answerHide answer
Correct answer: (A) 560
Explanation
Each cell needs 4 words. In row-major order, rows 0 to 10 contain 11 × 10 = 110 elements, and A[11][0] to A[11][4] add 5 more, so 115 elements precede A[11][5]. Address = 100 + 4 × 115 = 560.