-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart.c
41 lines (39 loc) · 770 Bytes
/
start.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
40
41
#include<stdio.h>
void main()
{
int a[5][5], b[5][5], d[5][5], r, c, i, j; // variable
printf("Enter r and c : ");
scanf("%d %d",&r,&c);
printf("Enter elements a : ");
for(i=0; i<r; i++)
{
for(j=0; j<c; j++)
{
scanf("%d",&a[i][j]);
}
} // first
printf("\nEnter elements b : ");
for(i=0; i<r; i++)
{
for(j=0; j<c; j++)
{
scanf("%d",&b[i][j]);
}
} // 2
printf("\naddition output : \n");
for(i=0; i<r; i++)
{
for(j=0; j<c; j++)
{
d[i][j] = a[i][j]-b[i][j];
}
}
for(i=0; i<r; i++)
{
for(j=0; j<c; j++)
{
printf("%d ",d[i][j]);
}
printf("\n");
}
}