Commit b0ace1a
committed
feat: Draw a rectangle using nested loops and conditionals
🧱 Logic:
- Outer loop iterates over rows; inner loop over columns
- Print '-' for top and bottom borders
- Print '|' for left and right borders
- Fill the rest with spaces to form a hollow rectangle.
Signed-off-by: Somesh diwan <[email protected]>1 parent 2214964 commit b0ace1a
File tree
1 file changed
+5
-9
lines changed- Section7ConditionalStatements/Loops/src
1 file changed
+5
-9
lines changedLines changed: 5 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
| 1 | + | |
| 2 | + | |
5 | 3 | | |
6 | 4 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 5 | + | |
| 6 | + | |
11 | 7 | | |
12 | 8 | | |
13 | 9 | | |
| |||
18 | 14 | | |
19 | 15 | | |
20 | 16 | | |
21 | | - | |
| 17 | + | |
0 commit comments