Commit 78db5be
committed
feat: Add right-aligned decreasing star pattern using nested loops
🧠 Logic:
- Outer loop controls rows (1 to 5).
- Inner loop prints either:
- "* " if current column (j) ≥ current row (i)
- " " (space) otherwise
- This creates a right-aligned decreasing triangle of stars.
Signed-off-by: Somesh diwan <[email protected]>1 parent ee029e7 commit 78db5be
1 file changed
+3
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
| |||
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
15 | | - | |
| 13 | + | |
0 commit comments