What are endless loops ? Why do such loops occur?
Question :
What are endless loops ? Why do such loops occur?
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.