Consider the following code segment.
int[][] multi = new int[4][4];
for (int rows = 0;...
![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 05.05.2021 03:10 amcalfie
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](/tpl/images/cats/User.png)
Answers: 3
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 19:30, Felixthecat7186
Anul 2017 tocmai s-a încheiat, suntem trişti deoarece era număr prim, însă avem şi o veste bună, anul 2018 este produs de două numere prime, 2 şi 1009. dorel, un adevărat colecţionar de numere prime, şi-a pus întrebarea: “câte numere dintr-un interval [a, b] se pot scrie ca produs de două numere prime? “.
Answers: 3
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 15:30, lizziesuks
What is the function of compilers and interpreters? how does a compiler differ from an interpreter?
Answers: 2
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 19:00, taridunkley724
Which of the following "invisible" marks represents an inserted tab?
Answers: 1
You know the right answer?
Questions in other subjects:
![Konu](/tpl/images/cats/obshestvoznanie.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/geografiya.png)
Geography, 26.10.2020 18:20
![Konu](/tpl/images/cats/mat.png)
Mathematics, 26.10.2020 18:20
![Konu](/tpl/images/cats/biologiya.png)
Biology, 26.10.2020 18:20
![Konu](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 26.10.2020 18:20
![Konu](/tpl/images/cats/en.png)
English, 26.10.2020 18:20
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/en.png)
English, 26.10.2020 18:20