subject

If numbers is a two-dimensional int array that has been initialized and total is an int that has been set to 0, which of the following will sum all the elements in the array?
1.for (int row = 0; row < numbers. length; row++) { for (int col = 0; col < numbers[row].length; col++) total += numbers[row][col]; }
2.for (int row = 0; row < numbers[row].length; row++) { for (int col = 0; col < numbers. length; col++) total += numbers[row][col]; }
3.for (int row = 1; row < numbers. length; row++) { for (int col = 1; col < numbers. length; col++) total += numbers[row][col]; }
4.for (int row = 0; row < numbers. length; row++) { for (int col = 0; col < numbers. length; col++) total += numbers[row][col]; }

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:30, 21megoplin
In which phase does software coding and testing happen in the spiral model? the spiral model does not have a separate testing phase. both, software coding and testing occurs during the phase.
Answers: 3
image
Computers and Technology, 23.06.2019 06:40, euniceyi56
How many nibbles can be stored in a 16-bit word?
Answers: 1
image
Computers and Technology, 23.06.2019 22:30, cuki96
Lakendra finished working on her monthly report. in looking it over, she saw that it had large blocks of white space. what steps could lakendra take to reduce the amount of white space?
Answers: 3
image
Computers and Technology, 24.06.2019 19:20, maehardy4134
Kiesha has a worksheet with a range of cells using the following columns: name, score, group, study group, and date. kiesha needs to sort the worksheet on the date field. which option she use to most efficiently complete this task ? a use the cut and paste option to reorganize the data to fit that order b use the filter function to organize the data based on the date c use the order function to organize the data based on the date d use the sort function to organize the data based on date order
Answers: 3
You know the right answer?
If numbers is a two-dimensional int array that has been initialized and total is an int that has bee...

Questions in other subjects:

Konu
Mathematics, 14.04.2021 16:30
Konu
Mathematics, 14.04.2021 16:30