Important MCQ

for(int i=1;i<=3;i++); (semicolon at the end) means the loop

Q.for(int i=1;i<=3;i++); (semicolon at the end) means the loop

A) has an empty body
B) does not compile
C) runs 3 times printing
D) is infinite
Correct Answer:
Option A
Detailed Explanation:
A) has an empty body 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.