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