Question 5Asked in UGC NET Computer Science, December 2014 (Paper II & III, Selected Questions)

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.

  1. A560
  2. B565
  3. C570
  4. D575
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.

From UGC NET Computer Science PYQ, December 2014 (Paper II & III, Selected Questions)

This is question 5 of UGC NET Computer Science PYQ, December 2014 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.