MENU
Question -

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



Answer -

Array A[25] [20]
Base Address = 42000
Size of element(W)= 2 bytes
A[I][J]=A[10][15] hence I=10 and J=15
Total Row (R) = 25
Total Column (C)= 20
A [I] [J] =B+ W[C(I-0)+(J-0)]
A[10] [15] =42000 +2[20(10-0)+(15-0)]
= 42000+2(20(10+15)]
= 42000+2[200+15]
= 42000+2(215]
= 42000+430]
= 42430

Comment(S)

Show all Coment

Leave a Comment

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