subject

Consider the following code segment, where num is a properly declared and initialized integer variable. The following code segment is intended to set foundRow and foundCol to the row and column indexes of an array element containing num. The code segment does not work as intended. int[][] arr = {{10, 11, 12, 13},

{22, 24, 26, 28},

{15, 16, 17, 18},

{40, 41, 42, 43}};

int foundRow = -1;

int foundCol = -1;

for (int j = 0; j < arr. length; j++)

{

for (int k = 1; k < arr[0].length; k++)

{

if (arr[j][k] == num)

{

foundRow = j;

foundCol = k;

}

}

}

Which of the following values for num can be used as a test case to show that the code segment does not work as intended?

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
What best describes a career pathway in a lodging career? a worker starts out as an amusement attendant, then becomes a recreation worker, and then becomes a gaming worker within five years. a worker starts out as a bell hop, then becomes a night clerk, and then becomes a hotel manager within five years. a worker starting out as a tour guide, then becomes a travel clerk, and then becomes a travel agent within five years. a worker starts out as a server, then becomes a food preparer, and then becomes a head chef within five years.
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
What is the total resistance in a circuit that contains three 60 ohm resistors connected in a series? a. 20 ohms b. 120 ohms c. 60 ohms d. 180 ohms
Answers: 2
You know the right answer?
Consider the following code segment, where num is a properly declared and initialized integer variab...
Questions
question
Mathematics, 28.11.2021 22:20
question
Mathematics, 28.11.2021 22:20
question
History, 28.11.2021 22:20
Questions on the website: 13722361