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

2

B

nothing will be printed

C

6

D

4

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

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