Program 16
Program 16
(b) Check if the given matrix is Symmetric or not. A square matrix is said to
be symmetric if the element of the I th row and jth column is equal to the
element of the jth row and Ith column
(c) Find the sum of the elements of left diagonal and the sum of the
elements of right diagonal of the matrix and display them.
Test your program with the sample data and some random data.
Example 1
Input : M=3
1 2 3
2 4 5
3 5 6
Output : Original Matrix
1 2 3
2 4 5
3 5 6
The Given Matrix is Symmetric
The sum of the left diagonal = 11
The sum of the right diagonal = 10
Example 2
Input : M=4
7 8 9 2
4 5 6 3
8 5 3 1
7 6 4 2