Update OOP/Java/Lab/Week4/MatrixMulp.java

This commit is contained in:
Aadit Agrawal 2024-08-31 01:24:44 +05:30
parent dfc539c64c
commit f7cc8cb99a

View File

@ -43,6 +43,7 @@ class MatrixMulp {
}
}
// Adding matrices
if (m == p && n == q) {
int[][] C = new int[m][n];
for (int i = 0; i < m; i++) {
@ -54,6 +55,7 @@ class MatrixMulp {
printMatrix(C);
}
// Multiplying matrices
if (n == p) {
int[][] D = new int[m][q];
for (int i = 0; i < m; i++) {