/* matrix Addition */
# include<stdio.h>
void main()
{
int
a[50][50],b[50][50],i,j,m,n;
printf("\n\n\t\tProgram to perform Matrix Addition\n");
RETRY:
printf("\nWARNING: Order of both Matrices must be same to perform
Addition");
printf("\nEnter the order of matrices\n");
scanf("%d%d",&m,&n);
printf("\nEnter the first matrix\n");
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
scanf("%d",&a[i][j]);
}
printf("\nEnter the second matrix\n");
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
scanf("%d",&b[i][j]);
}
printf("\n\n");
for(i=0;i<m;i++)
{
printf("\n\t");
for(j=0;j<n;j++)
printf(" %d",a[i][j]);
}
printf("\n\n\t +\n");
for(i=0;i<m;i++)
{
printf("\n\t");
for(j=0;j<n;j++)
printf(" %d",b[i][j]);
}
printf("\n\n\t =\n");
for(i=0;i<m;i++)
{
printf("\n\t");
for(j=0;j<n;j++)
printf(" %d",a[i][j]+b[i][j]);
}
printf("\nEnter 1 to Retry & 0 to Exit\n");
scanf("%d",&m);
if (m==1)
goto
RETRY;
}