Are you taking CLEP classes? Try clep.ai
| 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 2 students

2D Array Nested Loop Traversal

Mark
< 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

Question Leaderboard

Not enough data yet to show leaderboard.

AI Tutor

How can I help?

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