Write a method that sums all the numbers in the major diagonal in an n * n

Question:

Write a method that sums all the numbers in the major diagonal in an n * n matrix of double values using the following header:public static double?sumMajorDiagonal(double[][] m)Write a test program that reads a 4-by-4 matrix and displays the sum of all its elements on the major diagonal. Here is a sample run:image

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: