c ++ Program for addition of two matrix in diagonal using pointers code example
Example: c ++ Program for addition of two matrix in diagonal using pointers
/* C++ program for Sum of diagonal elements of a matrix */
#include
using namespace std;
int main()
{
int matrix[100][100], m, n ,i ,j, sum=0;
cout<<"Enter rows of matrix: ";
cin>>m;
cout<<"Enter columns of matrix: ";
cin>>n;
cout<<"Enter matrix elements: "<>matrix[i][j];
}
}
/* add diagonal elements into sum */
for(i=0;i