Question:What will be output when you will execute following c code?#include<stdio.h>
void main(){
int a=100;
if(a>10)
printf("M.S. Dhoni");
else if(a>20)
printf("M.E.K Hussey");
else if(a>30)
printf("A.B. de villiers");
}
Choose all that apply:
A M.S. Dhoni
B A.B. de villiers
C M.S Dhoni
M.E.K Hussey
A.B. de Villiers
D Compilation error: More than one
conditions are true
E None
+ ExplanationIn case of if – if else – if else … Statement if first if clause is true the compiler will never check rest of the if else clause and so on.