Q.

What will be the content of array variable table after executing the following code?

for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
if (j == i) {
table[i][j] = 1;
} else {
table[i][j] = 0;
}
}
}

A. 0 0 0 0 0 0 0 0 0.
B. 1 0 0 1 1 0 1 1 1.
C. 1 0 0 0 1 0 0 0 1.
D. 0 0 1 0 1 0 1 0 0.
Answer» C. 1 0 0 0 1 0 0 0 1.
3.8k
0
Do you find this helpful?
32

View all MCQs in

Java Programming

Discussion

No comments yet

Related MCQs