subject
Computers and Technology, 15.04.2021 03:20 butryn

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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:00
Suppose an astronomer discovers a large, spherical-shaped body orbiting the sun. the body is composed mostly of rock, and there are no other bodies sharing its orbit. what is the best way to categorize this body? a. planet b. moon c. comet d. asteroid
Answers: 1
question
Computers and Technology, 22.06.2019 21:00
The average cost of one year at a private college in 2012-2013 is $43,289. the average grant aid received by a student at a private college in 2012-2013 is $15,680.   what is the average student contribution for one year at a private college in 2012-2013?
Answers: 3
question
Computers and Technology, 23.06.2019 14:30
Open this link after reading about ana's situation. complete each sentence using the drop-downs. ana would need a minimum of ato work as a translator. according to job outlook information, the number of jobs for translators willin the future.
Answers: 3
question
Computers and Technology, 24.06.2019 00:50
Which player type acts on other players? a. killer b. achiever c. explorer d. socializer
Answers: 1
You know the right answer?
Consider the following code segment. int[][] multi = new int[4][4];

for (int rows = 0;...
Questions
question
Computers and Technology, 26.06.2019 23:30
Questions on the website: 13722363