Professional Documents
Culture Documents
h>
#define SZ 10
void addMatrices(int [][SZ], int [][SZ], int,int);
int (*(addMatrixReturn)(int [][SZ], int [][SZ], int,int))[SZ];
void inputMatrix( int [][SZ], int, int);
void printMatrix(int [][SZ], int, int );
int main()
{
int i,j, r1, c1, r2, c2;
int M1[SZ][SZ], M2[SZ][SZ], (*M)[SZ];
printf("\nEnter the number of rows and colums of Matrix 1");
scanf("%d%d",&r1,&c1);
printf("\nEnter the number of rows and colums of Matrix 2");
scanf("%d%d",&r2,&c2);
if(r1 == r2 && c1 == c2) {
printf("\nEnter the element of first matrix:");
inputMatrix(M1, r1, c1);
printf("\nEnter the second matrix:");
inputMatrix(M2, r2, c2);
addMatrices(M1, M2, r1, c1);