Q16
Which of the following correctly initializes a two-dimensional array named matrix in C++ with dimensions 3x3?
A.
int matrix[3][3] = {[1, 4, 7], [2, 5, 8], [3, 6, 9]};
B.
int matrix[3][3] = {[1, 2, 3], [4, 5, 6], [7, 8, 9]};
C.
int matrix[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
AnswerD.
int matrix[3][3] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
Answer: Option C
Solution
Answer: Option C
No explanation is given for this question Let's Discuss on Board