-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPSMADD.BAK
More file actions
55 lines (46 loc) · 985 Bytes
/
PSMADD.BAK
File metadata and controls
55 lines (46 loc) · 985 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//TITLE : WAP to ADD 2 MATRIX and Display Result
#include <stdio.h>
#include <conio.h>
void main()
{
int i,j;
int a[3][3],b[3][3],add[3][3];
clrscr();
printf("\nADD DATA TO MATRIX A :\n");
for (i=0;i<3;i++)
{
for (j=0;j<3;j++)
{
printf("Enter element for a[%d][%d]=",i,j);
scanf("%d",&a[i][j]);
}
}
printf("\nADD DATA TO MATRIX B :\n");
for (i=0;i<3;i++)
{
for (j=0;j<3;j++)
{
printf("Enter element for b[%d][%d]=",i,j);
scanf("%d",&b[i][j]);
}
}
printf("\n MATRIX A : \t\t MATRIX B :\t\t = MATRIX C \n ");
for (i=0;i<3;i++)
{
for (j=0;j<3;j++)
{
printf("%3d\t",a[i][j]);
}
for (j=0;j<3;j++)
{
printf("%3d\t",b[i][j]);
}
for (j=0;j<3;j++)
{
add[i][j] = a[i][j] + b[i][j];
printf("%3d",add[i][j]);
}
printf("\n");
}
getch();
}