C++ Program to Find Sum of Elements Above and Below Main Diagonal of Matrix

By | April 10, 2012

Here is the C++ program to find sum of elements above and below the main diagonal of square matrix.



Enter size of matrix(max 5):3
Enter the matrix:
1 2 3
4 5 6
3 0 2

Sum of elements above the diagonal:11
Sum of elements below the diagonal:7

Leave a Reply

Your email address will not be published. Required fields are marked *