Commit 08667a0
committed
feat: Print powers of 2 less than 100 using while loop
🧠 Logic:
- Initialize `i = 1`.
- Use `while(i < 100)` loop to repeatedly multiply `i` by 2.
- Print `i` in each iteration.
- Outputs: 1, 2, 4, 8, 16, 32, 64 (powers of 2 < 100).
Signed-off-by: Somesh diwan <[email protected]>1 parent 857ae5d commit 08667a0
1 file changed
+4
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 1 | + | |
| 2 | + | |
7 | 3 | | |
8 | | - | |
9 | | - | |
| 4 | + | |
10 | 5 | | |
11 | 6 | | |
12 | 7 | | |
13 | 8 | | |
14 | | - | |
| 9 | + | |
0 commit comments