# C Program to find theSum of Lower Triangular Elements of Matrix

## C Program to find theSumof the LowerTriangularElementsof Matrix

This page has a C Program to find the Sum of Lower Triangular Elements of Matrix. It is clear that, this C program will find the Sum of the Lower Triangular Elements of Matrix. The program is used to find the sum of the elements below the principal diagonal and the matrix elements below the principal diagonal are called Lower Triangular Elements of Matrix. The below given C program will find the Sum of Lower Triangular Elements of Matrix. Kindly check out the program to display the Sum of Lower Triangular Elements of Matrix.

### Sum of Lower Triangular Elements of Matrix Program

#include<stdio.h>
int main(){
int M[20][20];
int m, n, i, j, sum=0;
printf("\nEnter the Row and Column sizes of Matrix : ");
scanf("%d %d", &m, &n);
printf("\n\n Enter the Matrix elements one by one \n");
for (i = 1; i<=m; i++)
for (j = 1; j<=n; j++)
scanf("%d", &M[i][j]);
printf("\n The Given Matrix is : \n\n");
for (i = 1; i<=m; i++){
for (j = 1; j<=n; j++)
printf("\t%d ", M[i][j]);
printf("\n\n");
}
for (i = 1; i<=m; i++){
for (j = 1; j<=n; j++)
if(i>j)
sum=sum+M[i][j];
}
printf("\n The Sum of Lower Triangular elements of Matrix is %d", sum);
return(0);
}

Sample Output:

Enter the Row and Column sizes of Matrix : 4 4

Enter the Matrix elements one by one
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

The Given Matrix is :

1        2        3          4

5         6        7         8

9        10       11      12

13      14       15      16

The Sum of Lower Triagular elements of Matrix is 66

Related Popular Posts:

*  Write a c program to check whether a given number is prime number or not?

*  Write a C program to find the prime numbers between 1 and 100

*  Write a C program to display the prime numbers between a range ?

*  Write a C program to find the prime numbers between a range using while loop?

*  Write a C program to find the sum of prime numbers between a range