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?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:00
This program will store roster and rating information for a soccer team. coaches rate players during tryouts to ensure a balanced team. (1) prompt the user to input five pairs of numbers: a player's jersey number (0 - 99) and the player's rating (1 - 9). store the jersey numbers in one int vector and the ratings in another int vector. output these vectors (i.e., output the roster). (3 pts) ex: enter player 1's jersey number: 84 enter player 1's rating: 7 enter player 2's jersey number: 23 enter player 2's rating: 4 enter player 3's jersey number: 4 enter player 3's rating: 5 enter player 4's jersey number: 30 enter player 4's rating: 2
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Which type of file can be used to import data into a spreadsheet?
Answers: 1
question
Computers and Technology, 23.06.2019 03:00
State 7 common key's for every keyboard
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
You have been supporting csm tech publishing's windows server 2016 server network for over a year. the office has two windows server 2016 servers running active directory and a number of other roles. management has informed you that a small sales office is opening in the same building three floors up. the sales manager wants to install a sales application on a server located in the sales office. this server will have limited physical security because there's no special room dedicated for it, which means it will be accessible to non-it personnel and visitors. you're considering installing windows server 2016 server core on the new server because accessing its console regularly probably won't be necessary, and this server will be managed from one of the other csm tech publishing servers. what are the benefits and drawbacks of using server core for this branch office? what are some things you should do to set up this server management environment?
Answers: 1
You know the right answer?
Consider the following code segment. int[][] multi = new int[4][4];
for (int rows = 0; rows...
Questions
question
Chemistry, 31.07.2019 13:00
Questions on the website: 13722367