A C Program to find the sum of two matrix using two dimensional array.
Code:
#include <stdio.h>
#include<conio.h>
void main()
{
int a[10][10],b[10][10],c[10][10];
int i,j,n,m;
printf("Enter the order of matrix:);
scanf("%d%d",&n,&m);
printf("Enter the elements of matrix")
for(i=0;i<n;i++)
for(j=0;j<n;j++)
scanf("%d",&b[i][j]);
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
c[i][j]=a[i][j]+b[i][j];
}
}
printf("Addition of matrices");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
printf("%d\t",c[i][j]);
}
printf("\n");
}
getch();
return(0);
getch();
}