Computer Science, asked by chandanam0310, 1 year ago

Write a C program to print lower triangle of a square matrix.

For example the output of a given matrix

2 3 4 will be 2 0 0
5 6 7 5 6 0
4 5 6 4 5 6

Answers

Answered by ghgg26
2

what is that can u explain


0310lovely: program to print lower triangle of squre
0310lovely: square matix
0310lovely: matrix
0310lovely: #include
int main()
{
int matrix[20][20];
int i,j,r;

scanf("%d", &r); //Accepts number of rows or columns

for(i=0;i< r;i++) //Accepts the matrix elements from the test case data
{
for(j=0;j {
scanf("%d",&matrix[i][j]);
}
}
Answered by RaGhAv200407
0

Lower triangular matrix is a matrix which contain elements below principle diagonal including principle diagonal elements and rest of the elements are 0.

Upper triangular matrix is a matrix which contain elements above principle diagonal including principle diagonal elements and rest of the elements are 0.

LOWER TRIANGULAR :

{\displaystyle \begin{bmatrix} A_{00} & 0 & 0 & ... & 0\\ A_{10} & A_{11} & 0 & ... & 0\\ A_{20} & A_{21} & A_{22} & ... & 0\\ . & . & . & . & .\\ . & & & & \\ . & & & & \\ . & & & & \\ . & & & & \\ . & & & & \\ A_{row0} & A_{row1} & A_{row2} & ... & A_{rowcol} \end{bmatrix}}

UPPER TIRANGULAR :

{\displaystyle \begin{bmatrix} A_{00} & A_{01} & A_{02} & ... & A_{0col}\\ 0 & A_{11} & A_{22} & ... & A_{1col}\\ 0 & 0 & A_{22} & ... & A_{2col}\\ . & . & . & . & .\\ . & & & & \\ . & & & & \\ . & & & & \\ . & & & & \\ . & & & & \\ 0 & 0 & 0 & ... & A_{rowcol} \end{bmatrix}}


RaGhAv200407: i will ask my brother
RaGhAv200407: i am not specialised in it
0310lovely: no arrgent
RaGhAv200407: ok
RaGhAv200407: i will ask him and get it done
0310lovely: fastly
RaGhAv200407: now i cant contact him
RaGhAv200407: bro google this the program is available online
RaGhAv200407: quara
0310lovely: ok
Similar questions