Computer Science, asked by HARL174, 11 months ago

Assume base address 1000. Find the address of a[3][2] and a[1][2] of the array a[4] [4]

Answers

Answered by shaileshsh
0

Answer:

address a[0][0]=1000+(1-1)*4

a[0][1]=1000+(2-1)*4

a[0][2]=1000+(3-1)*8

similarly you can calculate for any element in array

Explanation:

address = base+(n-1)*size of datatype

where n specifies the position of element

this is the output of program to check address in multidimensional array

1732977680 0 0

1732977684 0 1

1732977688 0 2

1732977692 1 0

1732977696 1 1

1732977700 1 2

1732977704 2 0

1732977708 2 1

1732977712 2 2

Similar questions