C Program to Find Sum of Diagonals of Matrix

Here is the C program to find sum of diagonal of a square matrix.

 

Output

Enter size of square matrix:4
Enter Elements of matrix:
1 2 3 4
5 6 7 8
9 10 11 12
10 7 6 8

First Diagonal Sum=26
Second Diagonal Sum=31

Leave a Reply

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