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.
Loading...
Related Quiz
- Which keyword is used to inherit a class in C++?
- The goto statement can only jump to labels within the same _______.
- What is the difference between break and continue in the context of a loop?
- How does the C++ compiler handle tail-recursive functions?
- The memory allocated for a struct is equal to the sum of the memory of its individual members, considering _______.