C

Chandani • 9.82K Points
Tutor III

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.

Be the first to start discuss.


Question analytics