Learn basic concept of c , c++ and python programming in regularcodes.com

Spread the post

Print upper triangular matrix

Write an efficient algorithm to print upper triangular matrix in 2d array.

For example.

View matrix in array form

Stack Areamainarray [3,3] [0][0] 9[0][1] 8[0][2] 7[1][0] 6[1][1] 5[1][2] 4[2][0] 3[2][1] 2[2][2] 1col (int) =3row (int) =3

Program to display upper triangular matrix in c. Time complexity O(row*col).

Output

View process.

View steps of execution

Submit your solution in comment section.

Spread the post

Recommended Posts: