9
Question Question 9
Given that int z[ ][ ] = {{2, 6, 5}, {8, 3, 9}}; What will be value of z[1][0] and z[0][2] ?
- 2 and 9
- 8 and 5
- 2 and 5
- 6 and 3
8 and 5
Reason — Two-dimensional arrays are stored in a row-column matrix, where the first index indicates the row and the second indicates the column.
The element stored at z[1][0] refers to the element stored in second row and first column, which is 8.
The element stored at z[0][2] refers to the element stored in first row and third column, which is 5.