Create a free account on Computer Sir Ki Class and unlock access to valuable learning resources.
Exam Paper Downloads: After registering and logging in, you can download exam question papers in PDF format to practice and prepare for your exams.
Student Support: Get assistance with your doubts, queries, and questions related to your studies. Our support is here to help you understand topics and resolve your learning difficulties.
Register today and make your exam preparation easier and more effective!
R[10][50] is a two dimensional array, which is stored in the memory along the row with each of its element occupying 8 bytes, find the address of the element R[5][15], if the element R[8][10] is stored at the memory location 45000.
Answer:
Loc(R[I][J])
=BaseAddress + W [( I – LBR)*C + (J – LBC)]
(where
W=size of each element = 8 bytes,
R=Number of Rows=10, C=Number of Columns=50)
Assuming LBR = LBC = 0
LOC(R[8][10])
45000 = BaseAddress + W[ I*C + J]
45000 = BaseAddress + 8[8*50 + 10]
45000 = BaseAddress + 8[400 + 10]
45000 = BaseAddress + 8 x 410
BaseAddress = 45000 - 3280
= 41720
LOC(R[5][15])= BaseAddress + W[ I*C + J]
= 41720 + 8[5*50 + 15]
= 41720 + 8[250 + 15]
= 41720 + 8 x 265
= 41720 + 2120
= 43840
OR
Loc(R[I][J])
=Reference Address + W [( I – LR)*C + (J – LC)]
(where
W=size of each element = 8 bytes,
R=Number of Rows=10, C=Number of Columns=50)
Reference Address= Address of given cell R[8][10]=45000
LR = Row value of given cell = 8
LC = Column value of given cell = 10
LOC(R[5][15])= LOC(T[8][10]) + 8[(5 8)*50 + (15 10)]
LOC(R[15][5]) = 45000 + 8[3*50 + 5]
= 45000 + 8[150 + 5]
= 45000 + 8 x (145)
= 45000 1160
= 43840
C. Sir| Created: 1-Jan-2019 | Updated: 22-Mar-2026|CBSE12A-2016