-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatrix.c
More file actions
37 lines (31 loc) · 658 Bytes
/
Copy pathmatrix.c
File metadata and controls
37 lines (31 loc) · 658 Bytes
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
/* two dimensional array in c language */
#include <stdio.h>
#include <stdlib.h>
void main(void)
{
system("cls");
printf("sum of two matrix a*b \n\n");
int a[3][3],b[3][3],c[3][3] ,i ,j;
printf("Enter 9 numbers for first matrix:");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
scanf("%d",&a[i][j]);
}
printf("Enter 9 numbers for second matrix:");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
scanf("%d",&b[i][j]);
}
for (i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
c[i][j]=a[i][j]+b[i][j];
printf("%d ",c[i][j]);
}
printf("\n");
}
system("pause");
}