Computer Applications

Consider the following two-dimensional array and answer the questions given below:

int x[ ][ ] = {{4,3,2}, {7,8,2}, {8, 3,10}, {1, 2, 9}};

(a) What is the order of the array?

(b) What is the value of x[0][0]+x[2][2]?

Java Arrays

ICSE 2024

17 Likes

Answer

(a) The order of the array is 4 x 3 as it has 4 rows and 3 columns.

(b) The value is evaluated as follows:

x[0][0] = 4
x[2][2] = 10

x[0][0]+x[2][2] = 4 + 10 = 14

Answered By

8 Likes


Related Questions