While Loop Iteration Count
Consider the following code segment. How many times will the body of the while loop be executed?
int x = -3;
while (x < 0) {
x++;
}
A
4
B
2
C
5
D
3
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | patrickmeijer009 | 1 | 1 | 0m 15s | 85 |
| #2 | Potter16 | 1 | 1 | 0m 23s | 77 |
| #3 | busemagngr | 1 | 1 | 0m 38s | 62 |
| #4 | raufyildirim95 | 1 | 1 | 0m 46s | 54 |
| #5 | 6test6ing6 | 0 | 2 | 0m 00s | -20 |
| #6 | richa.tuli | 1 | 1 | 2m 19s | -39 |
| #7 | lsj08030922 | 1 | 1 | 12m 45s | -665 |
Items per page:
10
1 – 7 of 7
