109k views
1 vote
A two-dimensional array myArray is to be created with the following contents.

{{0, 0, 3},

{0, 0, 0},

{7, 0, 0}}

Which of the following code segments can be used to correctly create and initialize myArray ?



I. int myArray[][] = new int[3][3];
myArray[0][2] = 3;
myArray[2][0] = 7;

II: int myArray[][] = new int[3][3];
myArray[0][2] = 7;
myArray[2][0] = 3;

III: int myArray[][] = {{0, 0, 3}, {0, 0, 0}, {7, 0, 0}};


A) I only.

B) II only.

C) III only.

D) I and III.

E) II and III.

2 Answers

5 votes

Answer:

C

Step-by-step explanation:

good luck on AP bro

User Ptg
by
4.8k points
1 vote
the answer would be c
User Taskinul Haque
by
4.0k points