You are debugging a program that should print numbers from 1 to 10, but it's getting stuck and printing the same number indefinitely. What could be a possible reason?

  • Incorrect Print Statement
  • Infinite Loop
  • Memory Overflow
  • Syntax Error
The program printing the same number indefinitely suggests an infinite loop. Infinite loops can occur when the loop condition is not being updated correctly, leading to the program getting stuck on the same step. This can be due to a logical error in the loop's condition or the loop variable not being updated properly.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *