//WAP which stores element of two matrices, add two matrices and display the sum
matrix in proper format.
#include <stdio.h>
int main() {
int i, j, m, n, a[5][5], b[5][5], s[5][5];
printf("Enter size of rows and columns: ");
scanf("%d%d", &m, &n);
printf("Enter the elements of the first matrix:\n");
for (i = 0; i < m; i++) {
for (j = 0; j < n; j++) {
scanf("%d", &a[i][j]);
}
}
printf("Enter the elements of the second matrix:\n");
for (i = 0; i < m; i++) {
for (j = 0; j < n; j++) {
scanf("%d", &b[i][j]);
}
}
printf("The sum of the two matrices is:\n");
for (i = 0; i < m; i++) {
for (j = 0; j < n; j++) {
s[i][j]=a[i]+b[j];
printf("%d\t", s[i][j]);
}
printf("\n");
}
return 0;
}