Commit ca1b3d8
committed
feat: Demonstrate custom initialization and increment in for loop with skip pattern
🧠 Logic:
- The loop uses `System.out.println("Hi")` as the initialization block, which runs once before the loop starts.
- Loop variable `i` starts at 0, continues while `i <= 10`.
- Inside the loop, `i` is printed and then incremented again (in addition to the `i++` in the for-loop).
- This causes `i` to increment by 2 on each iteration, printing even-numbered values (0, 2, 4, ...).
Signed-off-by: Somesh diwan <[email protected]>1 parent a7fc0d5 commit ca1b3d8
1 file changed
+1
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
0 commit comments