Commit e84302d
committed
feat: Print square star pattern using nested loops based on user input
🧠 Logic:
- Read input `n` from the user to determine size of the square.
- Outer loop (`i`) runs from 1 to `n` to handle rows.
- Inner loop (`j`) runs from 1 to `n` to print `*` in each column of the row.
- After each inner loop completes, print a newline to format square shape.
Signed-off-by: Somesh diwan <[email protected]>1 parent 8535012 commit e84302d
1 file changed
+3
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | | - | |
17 | 15 | | |
18 | 16 | | |
0 commit comments