subject

Assume arr2 is declared as a two-dimensional array of integers. which of the following segments of code successfully calculates the sum of all elements arr2? int sum = 0; for(int j = 0; j < arr2.length; j++) { for(int k = 0; k < arr2[j].length; k++) { sum += arr2[k][j]; } } int sum = 0; for(int j = arr2.length − 1; j > = 0; j−−) { for(int k = 0; k < arr2[j].length; k++) { sum += arr2[j][k]; } } int sum = 0; for(int[] m : arr2) { for(int n : m) { sum += n; } }

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:10
David is in week 3 of his current ashford course and has a paper due by monday night at midnight. he has finished everything but the concluding paragraph. as he boots up his computer to work on it, he sees a flash across the screen and then the screen goes black. he begins to panic as he tries desperately to turn the laptop back on. david should have saved his work on what kind of portable device?
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
What is the most popular genre of video games?
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
The option enables you to modify a slide element in most presentation applications.
Answers: 2
question
Computers and Technology, 23.06.2019 18:30
This program should be a short piece of code that prints all of the positive integers from 1 to 100 as described more fully below. the program may contain multiple methods, and if using an oo language, should be contained within a single class or object. the program should be designed so that it begins execution when invoked through whichever mechanism is most common for the implementation language. â–ş print out all positive integers from 1 to 100, inclusive and in order. â–ş print messages to standard output, matching the sample output below. â–ş in the output, state whether the each integer is 'odd' or 'even' in the output. â–ş if the number is divisible by three, instead of stating that the number is odd or even, state that the number is 'divisible by three'. â–ş if the number is divisible by both two and three, instead of saying that the number is odd, even or divisible by three; state that the number is 'divisible by two and three'. â–ş design the logic of the loop to be as efficient as possible, using the minimal number of operations to perform the required logic. sample output the number '1' is odd. the number '2' is even. the number '3' is divisible by three. the number '6' is divisible by two and three.
Answers: 1
You know the right answer?
Assume arr2 is declared as a two-dimensional array of integers. which of the following segments of c...
Questions
question
English, 05.05.2020 11:09
question
Social Studies, 05.05.2020 11:09
Questions on the website: 13722366