Commit 62cbbc6
committed
feat: Multiply two 3x3 matrices using nested loops and store result in third matrix
🧠 Logic:
- Matrix A is multiplied with Matrix B (identity matrix) using the standard matrix multiplication algorithm.
- Uses three nested loops:
- Outer two loops iterate over each cell in result matrix C.
- Inner loop computes the dot product of row from A and column from B.
- Prints matrix C using enhanced for-each loop.
📌 Result is same as Matrix A because Matrix B is an identity matrix.
Signed-off-by: Somesh diwan <[email protected]>1 parent 882ea48 commit 62cbbc6
1 file changed
+7
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 8 | + | |
| 9 | + | |
12 | 10 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 11 | + | |
16 | 12 | | |
17 | 13 | | |
18 | 14 | | |
19 | 15 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
24 | 19 | | |
25 | 20 | | |
26 | 21 | | |
27 | 22 | | |
28 | 23 | | |
29 | | - | |
| 24 | + | |
0 commit comments