ShriRam Changed status to publish July 15, 2022
#include<stdio.h>
#include<stdio.h>
*/
void main()
{
int mat1[100][100],mat2[100][100],sum[100][100];
int i,j,row,col;
printf("Enter the number of rows and columns : \n");
scanf("%d%d",&row,&col);
printf("Enter the elements of the 1st matrix : \n");
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
scanf("%d",&mat1[i][j]);
}
}
printf("Enter the elements of the 2nd matrix : \n");
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
scanf("%d",&mat2[i][j]);
}
}
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
sum[i][j]=mat1[i][j]+mat2[i][j];
}
}
printf("The result of adding the two matrix : \n");
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
printf("%d\t",sum[i][j]);
}
printf("\n");
}
getch();
}
ShriRam Changed status to publish July 15, 2022