Important MCQ

int i=1; while(i<=3){cout<<i; i++;} prints

Q.int i=1; while(i<=3){cout<
A) 12
B) 123
C) nothing
D) 321
Correct Answer:
Option B
Detailed Explanation:
B) 123 is correct. A while loop checks its condition before each iteration, so it may run zero times. The loop body must update state when needed to avoid an unintended infinite loop.