Commit 572037b
committed
feat: Read and display a 2x2 matrix using nested loops
🧠 Logic:
- Declare a 2x2 integer matrix.
- Use nested `for` loops to input values from the user.
- Use nested loops again to print the matrix in row-major order.
- Demonstrates basic 2D array handling with Scanner input.
Signed-off-by: Somesh diwan <[email protected]>1 parent a29f8be commit 572037b
1 file changed
+11
-15
lines changedLines changed: 11 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
7 | 5 | | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 18 | + | |
| 19 | + | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
26 | | - | |
27 | 23 | | |
28 | 24 | | |
29 | | - | |
| 25 | + | |
0 commit comments