MENU
Question -

An array A[20] [30] is stored along the row in the memory with each element requiring 4 bytes of storage. If the base address of array A is 32000, find out the location of A[15][10]. Also, find the total number of elements present in this array.



Answer -

Array A[20] [30]
Base Address = 32000
Size of element(W)=4 bytes
A[I][J]=A[15][10] hence I=15 and J=10
Total Row (R)=20
Total Column (C)=30
A [I] IJ]=B + W[C(I-0)+(J-0)]
A[15][10]=32000 +4[30(15-0)+(10-0)]
= 32000+4[30(15)+10]
= 32000+4[450+10]
= 32000+4[460]
= 32000+1840
= 33840

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×