-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatric.c
42 lines (42 loc) · 984 Bytes
/
matric.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
42
#include <stdio.h>
int main()
{
int A[10][10],B[10][10],C[10][10],i,j,row,col;
printf("Enter no of rows of matrix");
scanf("%d",&row);
printf("Enter no of columns of matrix");
scanf("%d",&col);
printf("\nEnter A Matrix Elements\n");
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
printf("Enter matrix element A[%d][%d]",i,j);
scanf("%d",&A[i][j]);
}
}
printf("\nEnter B Matrix Elements\n");
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
printf("Enter matrix element B[%d][%d]",i,j);
scanf("%d",&B[i][j]);
}
}
printf("\nA Matrix elements are\n ");
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
printf("%d\t",A[i][j]);
}
printf("\n");
}
printf("\nB Matrix elements are\n ");
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
printf("%d\t",B[i][j]);
}