-
Notifications
You must be signed in to change notification settings - Fork 0
/
21.c
39 lines (36 loc) · 796 Bytes
/
21.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
29
30
31
32
33
34
35
36
37
38
39
#include <stdio.h>
int main()
{
int r, c;
printf("Enter Row:");
scanf("%d", &r);
printf("Enter Colomn:");
scanf("%d", &c);
int arr[r][c];
printf("Enter First %dx%d Martrics Elements\n", r, c);
for (int i = 0; i < r; i++)
{
for (int j = 0; j < c; j++)
{
scanf("%d", &arr[i][j]);
}
}
int arr_2[r][c];
printf("Enter Second %dx%d Matrics Elements\n", r, c);
for (int i = 0; i < r; i++)
{
for (int j = 0; j < c; j++)
{
scanf("%d", &arr_2[i][j]);
}
}
printf("Matrics After Addition\n");
for (int i = 0; i < r; i++)
{
for (int j = 0; j < c; j++)
{
printf("%d\t", arr[i][j] + arr_2[i][j]);
}
printf("\n");
}
}