Machine-translated by Google. Questions are authored in English.
Top

Discussion

Consider a two dimensional array A[20][10]. Assume 4 words per memory cell, the base address of array A is 100, elements are stored in row-major order and first element is A[0][0]. What is the address of A[11][5] ?

  • A.560
  • B.460
  • C.570
  • D.575

Answer: A

Correct answer: 560

Row-major, so \(A[i][j]\) sits at \(\text{base} + w\,(i \times \text{columns} + j)\), with 10 columns and \(w = 4\):

\[ 100 + 4\,(11 \times 10 + 5) = 100 + 4 \times 115 = 560 \]

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.