int m=90; if(m>=50) cout<<"P"; else if(m>=80) cout<<"D"; prints
Q.int m=90; if(m>=50) cout<<"P"; else if(m>=80) cout<<"D"; prints
A) PD
B) nothing
C) D
D) P
Correct Answer:
Option D
Detailed Explanation:
D) P is correct. An else-if ladder tests multiple conditions in order. Once one condition is true, its block runs and the remaining branches are skipped; the final else handles no match.