EASY LEVEL (1–10)
Nested Loops + break / continue
-
Print a 5x5 grid of numbers
Print numbers from 1 to 5 in 5 rows using nested loops.
Example:
Output:
12345
12345
12345
12345
12345
- Print multiplication table from 1 to 3
Output:
123
246
369
- Print triangle but skip number 2 using continue
Output:
1
13
134
- Print numbers 1 to 5 but stop completely if number 4 appears (use break).
- Nested loop: Stop inner loop when j == 3
Output:
12
12
12
- Skip printing even numbers inside nested loop (use continue).
- Print pattern but skip middle row using continue.