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
πŸ’¬ Discuss
βœ… Correct Answer: (A) if(exp1){ if(exp2){ } } else { if(exp3){ } }
Explanation: The correct syntax for nested if-else statements in C programming is:

if(exp1){
if(exp2){
}
}
else {
if(exp3){
}
}
Explanation by: Chandani
The correct syntax for nested if-else statements in C programming is:

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

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
354
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Chandani
Publisher
πŸ“ˆ
88%
Success Rate