In the mathematical discipline of linear algebra, a triangular matrix is a special kind of square matrix. A square matrix is called lower triangular if all the entries above the main diagonal are zero. Similarly, a square matrix is called upper triangular if all the entries below the main diagonal are zero.
a square matrix is said to be diagonal matrix if all its nondiagonal element is zero
or except diagonal elements all the elements are zero.