2(ix)
(a) Write the Java statement to initialize the first 6 odd numbers in a 3 × 2 array.
(b) What is the result of x[0][1] + x[2][1] of the above array?
Show SolutionHide Solution↓
(a) x[3][2] = {{1, 3}, {5, 7}, {9, 11}};
(b) 14
- x[0][1] = 3.
- x[2][1] = 11.
- Sum = 3 + 11 = 14.