O
2003
Consider an integer array int arr[4]
[5]. If base address is 1020, find the
address of Element arr[3][4] with row
major representation. Size of int is 2
bytes.
1020
O
1038
O
1039
1058
Answers
Answered by
5
Answer:
OpGive me like and best rating and follow for more questions and brainlisets
Answered by
1
Answer:
The address of A [3] [4] is 1058
Explanation:
We know that, in row Major,
Address of A [ i ] [ j ] = B + W [n (i - L₁) +(j - L₂)]
where, B = Base address
W = Size of each cell
n = No. of columns of the array
i = no. of rows of the array whose address is to be found
j = no. of columns of the array whose address is to be found
L₁ = Lower index of the row of the array
L₂ = Lower index of the column of the array
Therefore, on substitution,
A [3] [4] = 1020 + 2 [5 (3 - 0) +(4 - 0)]
= 1020 + 2[15 + 4]
= 1020 + 2 [19]
= 1020 + 38
= 1058
Therefore, the address of A [3] [4] is 1058
Similar questions
Math,
1 month ago
Social Sciences,
1 month ago
Computer Science,
1 month ago
English,
3 months ago
Chemistry,
10 months ago
Math,
10 months ago