Important MCQ

The correct syntax of a for loop is

Q.The correct syntax of a for loop is

A) for (init; condition; update)
B) for init; condition; update
C) for (init, condition, update)
D) for (init: condition: update)
Correct Answer:
Option A
Detailed Explanation:
A) for (init; condition; update) is correct. A for loop has initialization, condition, and update parts separated by semicolons. Initialization runs once; the condition controls repetition and the update changes the loop variable.