SSC
COMPUTER
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
True
|
|
False
|
|
Either A or B
|
|
None of the above
|
Detailed explanation-1: -An infinite loop–sometimes called an endless loop–is a piece of code that lacks a functional exit so that it repeats indefinitely. In computer programming, a loop is a sequence of instructions that is continually repeated until a certain condition is reached.
Detailed explanation-2: -We can generate an infinite loop intentionally using while True . In this case, the loop will run indefinitely until the process is stopped by external intervention ( CTRL + C ) or when a break statement is found (you will learn more about break in just a moment).
Detailed explanation-3: -The statement within the body of a loop must ensure that the test condition for the loop eventually becomes false, otherwise, the loop will run infinitely. Hence, the loop which doesn’t end is called an infinite loop.