Given the loop condition 'while loop != 999:', which value will terminate the loop?
Choose an answer
Tap an option to check your answer.
Correct answer: A value equal to 999..
Why this is the answer
The while loop continues to execute as long as its condition is true. The condition given is loop != 999, which means "loop is not equal to 999". Therefore, the loop will continue to run as long as the variable loop holds any value other than 999. The loop will terminate when the condition becomes false. The condition loop != 999 becomes false precisely when loop is equal to 999. Incorrect options: "A value not equal to 999" would cause the loop to continue, not terminate. "A value less than or equal to 999" is too broad; for example, if loop is 500, the loop continues. "A value greater than or equal to 999" is also too broad; for example, if loop is 1000, the loop continues.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed