C

Chandani • 10.97K Points
Tutor II

Q. Which of the following syntax is correct for nested if-else statements?

  • (A) if(exp1){ if(exp2){ } } else { if(exp3){ } }
  • (B) if(exp1){ }else { }
  • (C) if{}
  • (D) None of these

Explanation by: Chandani
The correct syntax for nested if-else statements in C programming is:

if(exp1){
if(exp2){
}
}
else {
if(exp3){
}
}

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics