Link copied to clipboard. Share away!

Dissmis

Published on 11 Mar 2020

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

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

C

C++

Java

Python 3

Output

Input the matrix elements :

1 2 3

0 1 2

0 0 3

Upper triangular matrix

1 2 3

0 1 2

0 0 3

Upper triangular matrix

*Recommended Programs*

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

×