Computer Science, asked by rizwan2husain, 2 days ago

C programming algorithm for find sum of diagonal element of matrix?​

Answers

Answered by rakeshsavant001
0

Explanation:

C program to find the sum of diagonal elements of a matrix

This C program is to find the sum of diagonal elements of a square matrix. ...

This C program is to find the sum of diagonal elements of a square matrix. ...1 2.

This C program is to find the sum of diagonal elements of a square matrix. ...1 2.3 4.

This C program is to find the sum of diagonal elements of a square matrix. ...1 2.3 4.Sum = 1+4 = 5.

This C program is to find the sum of diagonal elements of a square matrix. ...1 2.3 4.Sum = 1+4 = 5.1st iteration for(i=0;i<row;i++) i.e. for(i=0;0<2;i++) Outer loop.

This C program is to find the sum of diagonal elements of a square matrix. ...1 2.3 4.Sum = 1+4 = 5.1st iteration for(i=0;i<row;i++) i.e. for(i=0;0<2;i++) Outer loop.1st iteration for(j=0;j<col;j++) i.e. for(j=0;0<2;j++) Inner loop.

This C program is to find the sum of diagonal elements of a square matrix. ...1 2.3 4.Sum = 1+4 = 5.1st iteration for(i=0;i<row;i++) i.e. for(i=0;0<2;i++) Outer loop.1st iteration for(j=0;j<col;j++) i.e. for(j=0;0<2;j++) Inner loop.if(i==j) i.e. if(0==0) true.

This C program is to find the sum of diagonal elements of a square matrix. ...1 2.3 4.Sum = 1+4 = 5.1st iteration for(i=0;i<row;i++) i.e. for(i=0;0<2;i++) Outer loop.1st iteration for(j=0;j<col;j++) i.e. for(j=0;0<2;j++) Inner loop.if(i==j) i.e. if(0==0) true.sum=sum+mat[i][j]; i.e. sum=0+mat[0][0] i.e. sum=0+1 i.e. sum=1.

Similar questions