| preferred AP College board partner for AP classes
AP Computer Science A/Unit 8: 2D Array
Start Practice Test
Share
medium Solved by 4 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

6

B

2

C

nothing will be printed

D

4

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer

Question Leaderboard

Not enough data yet to show leaderboard.

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