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: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:50
Free points just awnser this. what should i watch on netflix
Answers: 2
question
Computers and Technology, 23.06.2019 07:00
Why were most movies from the late 1890s until the early 1930s only filmed in black and white? there were only a few people who could afford the technology to produce color motion pictures back then. audiences did not want color motion pictures until later. the film used to make color motion pictures often overheated, which was a safety hazard, so it was generally not allowed. color films had to be hand-colored, frame by frame.
Answers: 3
question
Computers and Technology, 23.06.2019 12:30
What is the difference between the internet and the world wide web?
Answers: 1
question
Computers and Technology, 23.06.2019 18:40
Johnson enterprises uses a computer to handle its sales invoices. lately, business has been so good that it takes an extra 3 hours per night, plus every third saturday, to keep up with the volume of sales invoices. management is considering updating its computer with a faster model that would eliminate all of the overtime processing.
Answers: 2
You know the right answer?
Consider the following code segment. int[][] multi = new int[4][4];

for (int rows = 0;...
Questions
question
Mathematics, 25.11.2020 03:00