Program to find if the given matrix is upper triangular or not | faceprep

Program to find if the given matrix is upper triangular or not | faceprep

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.

Program to find if the given matrix is upper triangular or not




Program to find if the given matrix is upper triangular or not

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

  • 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”.


face prep pro ad bannerClick here to learn more about FACE Prep PRO


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

@@coding::1@@


Recommended Programs


Program to find if the given matrix is upper triangular or not

c