## Saturday, 12 September 2020

1.

An array X [-15……….10, 15……………40] requires one byte of storage. If beginning location is 1500 determine the location of X .

2.

A matrix B is stored in the memory with each element requiring 2 bytes of storage. If the base address at B is 2140, find the address of B when the matrix is stored in Column Major Wise.

3.

Each element of an array arr requires ‘W’ bytes of storage. If the address of arr is 4440 and the base address at arr is 4000, find the width ‘W’ of each cell in the array arr[][] when the array is stored as Column Major Wise.

4.

A matrix ARR[-4…6, 3…8] is stored in the memory with each element requiring 4 bytes of storage. If the base address is 1430, find the address of ARR when the matrix is stored in Row Major Wise.

5.

A matrix A[m][m] is stored in the memory with each element requiring 4 bytes of storage. If the base address at A is 1500 and the address of A is 1608, determine the order of the matrix when it is stored in Column Major Wise.

6.

A matrix P is stored with each element requiring 8 bytes of storage. If the base address at P is 1400, determine the address at P when the matrix is stored in Row Major Wise.

7.

A matrix A[m][n] is stored with each element requiring 4 bytes of storage. If the base address at A is 1500 and the address at A is 1608, determine the number of rows of the matrix when the matrix is stored in Column Major Wise.

8.

The array D[-2…10][3…8] contains double type elements. If the base address is 4110, find the address of D, when the array is stored in Column Major Wise.

9.

An array AR[-4 … 6, -2 … 12], stores elements in Row Major Wise, with the address AR as 4142. If each element requires 2 bytes of storage, find the Base address.

10.

A square matrix M[][] of size 10 is stored in the memory with each element requiring 4 bytes of storage. If the base address at M is 1840, determine the address at M when the matrix is stored in Row Major Wise.

11.

A matrix B is stored in the memory with each element requiring 2 bytes of storage. If the base address at B[x] is 1012 and the address at B is 1060, determine the value ‘x’ where the matrix is stored in Column Major Wise

12.

A square matrix A [m × m] is stored in the memory with each element requiring 2 bytes of storage. If the base address at A is 1098 and the address at A is 1144, determine the order of the matrix A[m × m] when the matrix is stored in Column Major Wise

13.

A character array B has a base address 1046 at 0, 0. Calculate the address at B if the array is stored in Column Major Wise. Each character requires 2 bytes of storage.

14.

Each element of an array A requires 2 bytes of storage. If the address of A is 4000, find the base address at A when the array is stored in Row Major Wise.

15.

A two-dimensional array defined as X[3…6, -2…2] requires 2 bytes of storage space for each element. If the array is stored in Row Major Wise order, determine the address of X, given the base address as 1200.

Ans:

1    1660, 2285

2    2206

3    4

4    1610

5    6

6    2256

7    6

8     4366

9    3952

10    2032

11    3

12    5

13    1092

14    3864

15.    1226