Addresss Calculation
Addresss Calculation
Q1. Given the base address of an array ARR[100] as 1000 and size of each
element is 2 bytes in the memory. Find the address of ARR[26].
Q2. Given the base address of an array ARR[50] as X and size of each element is
4 bytes in the memory. Find the value of X if address of ARR[20] is 10024 .
Q3. Given the base address of an array ARR[n] as base(ARR) and size of each
element is esize bytes in the memory. Find the address of ARR[i].
Q4. Find the base address of an array ARR[n] if the address of ARR[i] is Y and
size of each element is esize bytes in the memory.
Q5. Given the base address of an array A[n] as base(A) and size of each element is
esize bits in the memory. Find the address of A[i].
Q6. Given the base address of an array B[5..12] as 1020 and size of each element is
2 bytes in the memory. Find the address of B[9].
Q7. Given the base address of an array B[1300…..1900] as 1020 and size of each
element is 4 bytes in the memory. Find the address of B[1700].
Q8. Given the base address of an array B[lb…..ub] as base(B) and size of each
element is esize bytes in the memory. Find the address of B [i], (where lb is lower
bound and ub is upper bound of array B).
Q9. An array ARR [3][4] requires one byte of storage. If beginning location is 100
determine the location of X [2][1] as in case of row major and column major
arrangements.
Q10. An array P [35][14] requires eight bytes of storage which stored along the
column. Find the base address and address of element p [2][5], if P [5][10] is
stored at address 4000.
Q11. An array Arr[50][30] requires four bytes of storage which stored along the
row. Find the base address and address of element Arr[15][25], if Arr[15][20] is
stored at address 8000.
Q13. A matrix A[m][m] is stored in the memory with each element requiring 4
bytes of storage. If the base address at A[1][1] is 1500 and the address of A[4][5] is
1608, determine the order of the matrix when it is stored in Column Major Wise.
Q14. Given an array, arr[1:9, -4:1, 5:10] with a base address of 400 and the size
of each element is 2 Bytes in memory find the address of element arr[5][-1][8]
with the help of row-major order?
Q15. Given an array, arr[1:9, -5:2, 4:11] with a base address of X and the size of
each element is 2 Bytes in memory if the address of element arr[4][0][7] is 5730
as row-major order?
Q16. Given an array arr[1:9, -5:5, -10:7] with a base value of Y and the size of
each element is 4 Bytes in memory if the address of element arr[4][4][1] is
94120 as column-major order?
Q17. Given an array arr[1:8, -5:5, -10:5] with a base value of 400 and the size of
each element is 4 Bytes in memory find the address of element arr[3][3][3] with
the help of column-major order?