Question: C++ In class Exercise ICE 3/8 - Due on or before 10:00pm Objective: Two dimensional arrays Important instructions: All programs must include comments at the
C++
In class Exercise ICE 3/8 - Due on or before 10:00pm
Objective: Two dimensional arrays
| Important instructions:
|
SumOfDiagonal.cpp
Write a program that reads a 4-by-4 matrix and display the sum of all its elements on the major diagonal, sub-diagonal (below major diagonal) and super-diagonal (above major diagonal).

Sample Output:
Enter a 4 by 4 matrix row by row:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
Sum of the elements in the major diagonal is 34
Sum of the elements in the sub-diagonal is 30
Sum of the elements in the super-diagonal is 21
Given function prototypes
double sumMajorDiagonal(const double m[][SIZE]);
double sumSubDiagonal(const double m[][SIZE]);
double sumSuperDiagonal(const double m[][SIZE]);
Copy and paste your program (source) code and the outputs after this line
+++++++++++++++++++++++++++++++++++++++++++++++++
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
