Commit 8535012
committed
feat: Print right-angled triangle star pattern using nested loops
🧠 Logic:
- Take input `n` from user to define the number of rows.
- Outer loop (`i`) runs from 1 to `n` to manage rows.
- Inner loop (`j`) runs from 1 to `i` to print increasing stars on each row.
- Print a newline after each row to form the triangle shape.
Signed-off-by: Somesh diwan <[email protected]>1 parent 189c61e commit 8535012
1 file changed
+5
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
6 | 4 | | |
7 | | - | |
| 5 | + | |
8 | 6 | | |
9 | 7 | | |
| 8 | + | |
10 | 9 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 10 | + | |
| 11 | + | |
16 | 12 | | |
17 | 13 | | |
18 | | - | |
| 14 | + | |
19 | 15 | | |
20 | 16 | | |
21 | 17 | | |
0 commit comments