Important MCQ

Output? int x = 15; if (x > 10) cout << "A"; if (x > 12) cout << "B"; else if (x > 14) cout << "C"; else cout << "D";

Q.Output? int x = 15; if (x > 10) cout << "A"; if (x > 12) cout << "B"; else if (x > 14) cout << "C"; else cout << "D";

A) A
B) AB
C) ABC
D) AD
Correct Answer:
Option B
Detailed Explanation:
Two separate chains: first if prints A; second chain prints B and skips the rest.