subject

Consider the following code segment. int[][] multi = new int[4][4];

for (int rows = 0; rows < 4; rows++)

{

for (int cols = 0; cols < 4; cols++)

{

if (cols == 0)

{

multi[rows][cols] = 0;

}

else if (cols == 1)

{

multi[rows][cols] = 1;

}

else if (cols == 2)

{

multi[rows][cols] = 2;

}

if ((rows % 2 == 0) && (cols % 2 == 0))

{

if ((rows >= 2) && (cols <= 2))

{

multi[rows][cols] = 9;

}

}

}

}

As a result of executing the code segment, how many elements in the two-dimensional (2D) array multi will store the value 9 ?

A) 0
B)1
C)2
D)4
E)6

ansver
Answers: 1

Another question on Advanced Placement (AP)

question
Advanced Placement (AP), 23.06.2019 02:30
Daryl wouod like to open new checkings and savings accounts one pf his primary concerns is avoiding bank fees
Answers: 2
question
Advanced Placement (AP), 23.06.2019 11:50
Willing to give brainliest + free points answer quickly a tire without good traction has less a. grip on the road b. grip on the axle c. air in it d. risk of exploding
Answers: 2
question
Advanced Placement (AP), 26.06.2019 10:00
How much hazardous chemical waste is produced per year in the us? a) 25 million metric tons b) 100 million metric tons c) 250 million metric tons d) 700 million metric tons e) 950 million metric tons
Answers: 1
question
Advanced Placement (AP), 26.06.2019 22:30
1. any body of surface water in which water is stored is a(n) aquifer reservoir channel floodplain 2.which of the following is a source of groundwater replenishment? seepage into springs infiltration from the surface evaporation all of the above 3. watersheds are bounded by points of high elevation called drainage basins. true false 4.non-native species can harm watershed environments by competing with native species for food. true false
Answers: 1
You know the right answer?
Consider the following code segment. int[][] multi = new int[4][4];

for (int rows = 0;...
Questions
Questions on the website: 13722367