A

Admin • 802.91K Points
Coach

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.
  • Correct Answer - Option(C)
  • Views: 6
  • Filed under category Java
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.