2D Array Row Manipulation
Consider the following code:
int [][] values = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}};
for (int r = values.length - 1; r > 0; r--)
{
for (int c = 0; c < values[r].length; c++)
{
values[r - 1][c] = values[r][c];
}
}
Which of the following represents the current values in the array?
A
12 11 10 9
8 7 6 5
4 3 2 1
B
5 6 7 8
9 10 11 12
9 10 11 12
C
9 10 11 12
9 10 11 12
9 10 11 12
D
1 2 3 4
1 2 3 4
1 2 3 4
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE