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

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 *

This site uses Akismet to reduce spam. Learn how your comment data is processed.