Explore
ProGrad Programs
About Us

Edit
Reply




Edit

Program to find if the given matrix is lower triangular or not | FACE Prep

Published on 11 Mar 2020

Program to find if the given matrix is lower triangular or not is discussed here. A square matrix is obtained as input from the user and it is checked if it is lower triangular or not. A square matrix is said to be a lower triangular matrix if all the entries above the diagonal are zero.

Algorithm to check if the given matrix is lower triangular or not


  • Input the order of the square matrix.
  • Input the matrix elements.
  • Repeat from i = 0 to n.
  • Repeat from j = 1+1 to n.
  • if (mat[i][j] != 0)
  • Set flag = 0 and print "Not a Lower Triangular Matrix".
  • Else, print "Lower Triangular Matrix".


Program to check if the given matrix is lower triangular or not


C
C++
Java
Python 3

Output
Enter the order of the matrix : 3
Input the matrix elements :
1 0 0
1 2 0
2 5 0
Lower Triangular Matrix


Recommended Programs







If you have any feedback about this article and want to improve this, please write to enquiry@faceprep.in
Explore 'c'
Articles