- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmulMatrix.java
More file actions
Latest commit
32 lines (28 loc) · 658 Bytes
/
Copy pathmulMatrix.java
File metadata and controls
32 lines (28 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
classmulMatrix
{
publicstaticvoidmain(String[] args)
{
intA[][]={{3,5,9},{7,6,2},{4,3,5}};
intB[][]={{1,0,0},{0,1,0},{0,0,1}};
intC[][]=newint[3][3];
for(inti=0;i<3;i++)
{
for(intj=0;j<3;j++)
{
C[i][j]=0;
for(intk=0;k<3;k++)
{
C[i][j]=C[i][j]+A[i][k]*B[k][j];
}
}
}
for(intx[]:C)
{
for(inty:x)
{
System.out.print(y+" ");
}
System.out.println("");
}
}
}