Which of the following is true about the for loop in C?
AA for loop cannot be nested inside another for loop.
BThe condition in a for loop is optional, and it can result in an infinite loop if omitted.
CA for loop must always have all three components: initialization, condition, and
increment/decrement.
DThe increment/decrement part of the for loop is mandatory.
Show answerHide answer
Correct answer: (B) The condition in a for loop is optional, and it can result in an infinite loop if omitted.
Explanation
All three parts of a for loop are optional. If the condition is omitted, it is treated as always true, e.g. for(;;), giving an infinite loop unless break is used. For loops can also be nested.