PRASHNIKAप्रश्निका
Back to the paper

A matrix N[11][8] is stored in the memory with each element requiring 2 bytes of storage. If the…

Computer Science20232 marksNumerical
A matrix N[11][8] is stored in the memory with each element requiring 2 bytes of storage. If the base address at N[2][3] is 2140, find the address of N[7][5] when the matrix is stored in Row Major Wise.

Answer

Answer

AI
Row Major formula relative to a known base address: $Address(N[i][j]) = Base(N[2][3]) + W \times [(i-2)\times C + (j-3)]$, where $C$ = number of columns = 8, $W$ = 2 bytes For $N[7][5]$: $= 2140 + 2 \times [(7-2)\times 8 + (5-3)]$ $= 2140 + 2 \times [40+2]$ $= 2140 + 84$ Final answer: 2224

Final answer: 2224 bytes (address)

Arrays, Strings

From ISC 2023 Specimen Computer Science Paper 1, question 2(ii).