ISRO Scientist/Engineer CSE 2020Programming in C › Pointers and Arrays
ISRO Scientist/Engineer CSE 2020 PYQ: Consider a 2-dimensional array $x$ with 10 rows and 4 columns, with each element storing a value equivalent…
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 is stored in row-major format. If the first element $x[0][0]$ 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?
- A1018,1019
- B1022,1041Correct answer
- C1013,1014
- D1000,1399
Answer
(B) $1022,1041$
Approach
The array is 10×4 with x[i][j]=i×j. For product 10, the only valid index pair within bounds is (5,2), since (10,1) requires row index 10 which is out of range for 10 rows (indices 0–9). Row-major address = 1000 + 5×4 + 2 = 1022. Option B is the only option containing 1022; the second address 1041 corresponds to the invalid (10,1) pair, indicating the question likely intended 11 rows. Therefore the intended answer is B.
Reviewed by ISRO IQ Editorial Team.