Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
medium Solved by 2 students

2D Array Nested Loop Traversal

< Prev
Next >

What is the third value printed when the following code segment is executed?

int[][] table = {
    {4, 4, 4},
    {2, 2, 2},
    {6, 6, 6},
    {1, 1, 1}
};
for (int col = 0; col < table[0].length; col++) {
    for (int row = table.length - 1; row > col; row--) {
        System.out.println(table[row][col]);
    }
}
A

nothing will be printed

B

6

C

2

D

4

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question
Mark for review

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy|FAQ