Commit 413acc9
committed
feat: Print powers of 2 using do-while loop until less than 100
🧠 Logic:
- Initialize `i = 1`, then use a `do-while` loop to print and double `i` on each iteration.
- Loop continues while `i < 100`, resulting in values: 1, 2, 4, 8, 16, 32, 64.
- Demonstrates guaranteed execution at least once using `do-while`.
Signed-off-by: Somesh diwan <[email protected]>1 parent 18dfb91 commit 413acc9
1 file changed
+1
-2
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 | | |
| |||
0 commit comments