An upper triangular matrix is a matrix in which all the lower triangular elements are zero, or all the elements below the principle diagonal will be zero.
Given a matrix, we have to print its upper triangular.
Example:
Input:
matrix:
[2, 3, 4]
[5, 6, 7]
[8, 9, 8]
Output:
Upper Triangular of Matrix :
[2, 3, 4]
[0, 6, 7]
[0, 0, 8]
Program to print upper triangular matrix in Kotlin
Output
need an explanation for this answer? contact us directly to get an explanation for this answer