175k views
2 votes
Something within a while loop must eventually cause the condition to become false, or a(n) __________ results.

1. null value

2. infinite loop

3. unexpected exit

4. compiler error

5. None of these

1 Answer

1 vote

Answer: Infinite loop

Step-by-step explanation:

A while loop terminates when the condition within the loop becomes false else the it will continue to loop for ever and thereby lead to memory overflow.

example : while(i<10)

{ print("hello");

}

here if value of i <10 then it will print hello, but if there is no condition it will lead to an infinite loop. example : while();

User Phil Cross
by
4.7k points