forked from gne-ldh/PPS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP22.c
More file actions
40 lines (39 loc) · 702 Bytes
/
P22.c
File metadata and controls
40 lines (39 loc) · 702 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
38
39
40
//PROGRAM TO FIND SUM OF TWO MATRICES
#include<stdio.h>
void main()
{
int a[3][3],b[3][3], sum[3][3],i,j;
printf("\nEnter elements of the first 3X3 matrix::");
for(i=0;i<=2;i++)
{
printf("\n Enter elements of row %d :: ", i+1);
for(j=0;j<=2;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\nEnter elements of the second 3X3 matrix::");
for(i=0;i<=2;i++)
{
printf("\n Enter elements of row %d :: ", i+1);
for(j=0;j<=2;j++)
{
scanf("%d",&b[i][j]);
}
}
printf("\nThe first 3X3 matrix is::\n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
printf("%d ",a[i][j]);
}
printf("\n");
}
printf("\nThe second 3X3 matrix is::\n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
printf("%d ",b[i][j]);
}