Question: please use regular java for this question, along with the use of arrays D - 1.png Write a program to add the elements on the
D - 1.png Write a program to add the elements on the two diagonals of a square two dimensional integer array and display that sum. Ensure that if there is a middle element in the array it is not counted twice in the sum For example, with the array: 1 5 9 2 6 3 7 4 8 12 16 10 14 11 15 13 your program should display 68 (1 +6+11+16+4+7+10+13). With the array: 3 1 2 5 6 9 10 7 11 your program should display 30 (1+6+11+3+9) (note that the 6 is not counted twice)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
