Commit 14ce147
committed
feat: Print right-angled triangle number pattern using nested loops
🧠 Logic:
- Accept user input `n` to define number of rows.
- Outer loop (`i`) runs from 1 to `n` to represent each row.
- Inner loop (`j`) runs from 1 to `i` to print increasing numbers from 1 to `i`.
- After each row, print a newline to create a right-angled triangle pattern.
Signed-off-by: Somesh diwan <[email protected]>1 parent e84302d commit 14ce147
1 file changed
+4
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
5 | 4 | | |
6 | 5 | | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 9 | + | |
| 10 | + | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
| |||
0 commit comments