What code should i type?? Plz give ans .that it very important for me.input and output is give in question in description box.. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What code should i type?? Plz give ans .that it very important for me.input and output is give in question in description box..

In this assignment, you will be given an NxN matrix. You have to determine whether the matrix is a triangular matrix.  The diagonal of the matrix M of size NxN is the set of entries M(0,0), M(1,1), M(2,2), ..., M(N,N).  A matrix is upper triangular if every entry below the diagonal is 0. For example,   1 1 1 0 0 1 0 0 2 is an upper triangular matrix. (The diagonal itself, and the entries above and below the diagonals can be zeroes or non-zero integers.)  A matrix is lower triangular if every entry above the diagonal is 0. For example,  2 0 0 3 1 0 4 2 2 is a lower triangular matrix.  A matrix is triangular if it is either upper triangular or lower triangular or both.   You may not use arrays for this program. Input First, you will be given N, which is the size of the matrix. Then you will be given N rows of integers, where each row consists of N integers separated by spaces.  Output If the input matrix is triangular, then print yes. Otherwise, print no. 

6th Aug 2019, 6:27 PM
Bhargav Bhatiya
Bhargav Bhatiya - avatar
1 Answer
0
Correct me if wrong The case input 3 1 2 3 4 5 6 7 8 9 The case ouput Not tringular matrix And in tringular matrix, the diagonal shouldn't be zero?
24th Feb 2020, 3:41 PM
Tegar
Tegar - avatar