CBSE Class 11 Computer Science Question 90 of 161

Flow of Control — Question 14

Back to all questions
14
Question

Question 14

What are endless loops ? Why do such loops occur?

Answer

A loop which continues iterating indefinitely and never stops is termed as an endless or infinite loop. Such loops can occur primarily due to two reasons:

  1. Logical errors when the programmer misses updating the value of loop control variable.
  2. Purposefully created endless loops that have a break statement within their body to terminate the loop.
Answer