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?
A) for (int row = 1; row < numbers.length; row++)
{
For (int col = 1; col < numbers.length; col++)
Total += numbers[row][col];
}
B) for (int row = 0; row < numbers.length; row++)
{
For (int col = 0; col < numbers.length; col++)
Total += numbers[row][col];
}
C) for (int row = 0; row < numbers[row].length; row++)
{
For (int col = 0; col < numbers.length; col++)
Total += numbers[row][col];
}
D) for (int row = 0; row < numbers.length; row++)
{
For (int col = 0; col < numbers[row].length; col++)
Total += numbers[row][col];
}
Correct Answer:
Verified
Q48: What will be the result after the
Q49: Given the following two-dimensional array declaration, which
Q50: For the following code, what would be
Q51: What will be the results after the
Q52: What would be the result after the
Q54: Which of the following for loops is
Q55: If final int SIZE = 15 and
Q56: Given that String[ ] str has been
Q57: What will be the value of x[8]
Q58: What will be the results after the
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents