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

An array is stored Row Major Wise. The address of is . If each element occupies bytes in the…

Computer Science20262 marksOne word
An array $Arr[3 \dots 8, -5 \dots 5]$ is stored Row Major Wise. The address of $Arr[5][-2]$ is $5120$. If each element occupies $4$ bytes in the memory, find the base address of the array.

Answer

Answer

AI
Row Major Wise, number of columns per row $= 5-(-5)+1 = 11$. Address(Arr[5][-2]) = Base + [(5-3)×11 + (-2-(-5))] × 4 = Base + (22+3)×4 = Base + 100 Given Address(Arr[5][-2]) = 5120, so: Base address = 5120 - 100 = 5020
Arrays, Strings

From ISC 2026 Improvement Computer Science Paper 1, question 2(ii).