1

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; } } }

Correct Answer: 1 0 0 0 1 0 0 0 1.

Make the most of this question

This page focuses on one JAVA MCQs question from Programming. After checking the answer, return to the topic list to practice more or run a timed set.

JAVA MCQs MCQ: 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; } } } | Extra Education