In a for loop, what will happen if the condition is omitted? 

  • It will throw a syntax error. 
  • The loop will execute once. 
  • The loop will never execute. 
  • The loop will execute indefinitely.
In a for loop, if the condition is omitted, it's treated as always true. Therefore, the loop will execute indefinitely unless there's a break statement or some external factor that interrupts its execution.
Add your answer
Loading...

Leave a comment

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