Skip to content

Commit 36312c6

Browse files
authored
Update introduction.md (#2479)
Previously, the comment implied that the loop executes only when the condition is true, which is misleading for a do-while loop. Updated the comment to clearly reflect that the loop body executes at least once before the condition (x > 10) is evaluated, and continues only if the condition remains true. This improves readability and helps avoid confusion between while and do-while behavior.
1 parent 266f814 commit 36312c6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

concepts/do-while-loops/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ int x = 23;
77

88
do
99
{
10-
// Execute logic if x > 10
10+
// Always executes at least once, then repeats as long as x > 10
1111
x = x - 2;
1212
} while (x > 10)
1313
```

0 commit comments

Comments
 (0)