Question: need help with this 2d array problem Replace the ADD CODE HERE below with the code to find the sum of the values on the
need help with this 2d array problem
Replace the ADD CODE HERE below with the code to find the sum of the values on the diagonal from [O][O] to [num rows - 1][num rows - 1]. Print the sum. It should print 5. Save & Run Load History Show CodeLens 1 public class Test1 2 { 3 4 5 public static void main(String[] args) { int[][] array { {1,2,3},{-1, -2,-3},{4,5,6} }; 6 7 8 //ADD CODE HERE 9 10 } 11} 12 Matis it Atnaden
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
