Multiple choice

Which of the following is not an infinite loop?

  1. for(int i=1;;i++)

  2. for(int i=1;i<=10;)

  3. for(int i=4;i<5;i++)

  4. for(;;)

  5. none of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

i=44<5. As this is true, the loop is executed atleast once.