Important MCQ

int x=10; if(x>5){ if(x>20) cout<<"A"; else cout<<"B";} else cout<<"C"; prints

Q.int x=10; if(x>5){ if(x>20) cout<<"A"; else cout<<"B";} else cout<<"C"; prints

A) AB
B) C
C) B
D) A
Correct Answer:
Option C
Detailed Explanation:
C) B is correct. A nested if is an if statement inside another if. The inner condition is reached only if execution enters the outer block; braces and indentation make the structure clear.