Infinite Loop Conditions
Consider the following pseudocode with count initialized to 0:
REPEAT UNTIL (count > max)
count ← count + step
DISPLAY(count)
For which combination of values would this code result in an infinite loop?
A
max = -5, step = -1
B
max = 0, step = 0
C
max = 10, step = 2
D
max = 10, step = -1
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | manessa.hachem2011 | 2 | 2 | 0m 00s | 200 |
| #2 | bhavinidixit0311 | 1 | 1 | 0m 00s | 100 |
| #3 | ballsgaming214 | 1 | 1 | 0m 44s | 56 |
| #4 | jjacobs | 1 | 2 | 1m 19s | 11 |
| #5 | soniahalepota2005 | 1 | 2 | 1m 36s | -6 |
| #6 | jdvillalta865 | 1 | 3 | 2m 01s | -41 |
| #7 | mahmoudjibrin08 | 1 | 3 | 2m 35s | -75 |
| #8 | tianbo.shen | 1 | 1 | 7m 59s | -379 |
Items per page:
10
1 – 8 of 8
APFIVE