| preferred AP College board partner for AP classes
AP Computer Science A/Unit 8: 2D Array
Start Practice TestPractice Test
About Exam
easy Solved by 5 students
2D Array Population With Nested Loops
< Prev
Next >

Consider the following code segment:

int[][] data = new int[3][3];
for (int m = 0; m < data.length; m++)
{
    for (int n = 0; n < data[0].length; n++)
    {
        data[m][n] = m * n;
    }
}

What are the contents of data after the code segment has executed?

A

0 1 2
0 2 4
0 3 6

B

0 0 0
0 1 2
0 2 4

C

1 1 1
2 2 2
3 3 3

D

1 2 3
2 4 6
3 6 9

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1lightingstrikes134222 0m 00s 200
#2vempaami00011 0m 00s 100
#3deltasmpserver11 0m 00s 100
#4y.seong202711 0m 46s 54
Items per page:
10
1 – 4 of 4
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: [email protected]|Privacy Policy