C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
int main () {
int r , c , a[100][100] , b[100][100] , sum[100][100], i , j;
printf("Enter number of rows:");
scanf("%d", &r);
printf("Enter number of columns:");
scanf("%d", &c);
printf("Enter elements of 1st matrix:");
for(i = 0; i < r ; i++)
for(j = 0; j < c; j++)
{
printf("Elements of 1st are a%d%d:", i+1, j+1);
scanf("%d", &a[i][j]);
}
printf("\n Elements of 2nd matrix:\n");
for(i = 0; i < r;i++)
for(j = 0 ; j < c;j++)
{
printf("Elemets of 2nd are b%d%d", i+1, j+1);
scanf("%d", &b[i][j]);
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run