Important MCQ

int x=10; if(x<5) cout<<1; else cout<<2; cout<<3; prints

Q.int x=10; if(x<5) cout<<1; else cout<<2; cout<<3; prints

A) 13
B) 23
C) 2
D) 123
Correct Answer:
Option B
Detailed Explanation:
B) 23 is correct. An if-else statement makes a two-way decision: the if block runs when the condition is true, otherwise the else block runs. Exactly one branch is selected.