# ISRO | ISRO CS 2020 | Question 80

• Difficulty Level : Basic
• Last Updated : 09 Aug, 2021

Consider a 2-dimensional array x with 10 rows and 4 columns, with each element storing a value equivalent to the product of row number and column number. The array row major format. If the first element x occupies the memory location with address 1000 and each element occupies only one memory location, which all locations (in decimal) will be holding a value of 10 ?
(A) 1018, 1019
(B) 1022, 1041
(C) 1013, 1014
(D) 1000, 1399

Explanation: Let’s visualize this question by actual a matrix of 10×4, now to achieve value of ’10’ as per the condition of ‘each element storing a value equivalent to the product of row number and column number’, X and X are the only possible combination which will happen.

So keeping those in mind as X holds address of 1000, for X and X, we’ll get two different addresses so let’s find out for X, As the array is stored in row-major format, We have to travel 10 rows of 4 columns from the base address and then in that row travel 1 columns get the required location, which is mathematically, X*=1000+1[4(10-0)+(1-0)]=1000+41=1041 And same way for X, calculation will be,

```X*
= 1000+1[4(5-0)+(2-0)]
= 1000 + 22
= 1022 ```

So the answer is 1022 & 1041.

Quiz of this Question

My Personal Notes arrow_drop_up