Commit 297ff2b
committed
feat: Print right-angled triangle star pattern using nested loops
🧠 Logic:
- Use two nested `for` loops to print a right-angled triangle made of `*`.
- Outer loop (`i`) runs from 0 to 5 (6 rows total).
- Inner loop (`j`) runs from 0 to `i`, printing `*` in each iteration.
- After printing stars for one row, move to the next line using `println()`.
- Output:
*
**
***
****
*****
******
Signed-off-by: Somesh diwan <[email protected]>1 parent ec43a17 commit 297ff2b
1 file changed
+5
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
9 | 5 | | |
10 | 6 | | |
11 | 7 | | |
12 | 8 | | |
13 | 9 | | |
14 | | - | |
| 10 | + | |
0 commit comments