Q. Which of these if...else block syntax is correct?

  • (A) if(condition){ } else { }
  • (B) if(condition){ } else(condition){ }
  • (C) if{ } else { }
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (A) if(condition){ } else { }
Explanation: The syntax of if...else block of code in C is:

if(condition){
// true block
}
else {
// false block
}
Explanation by: Kanak Sharma
The syntax of if...else block of code in C is:

if(condition){
// true block
}
else {
// false block
}

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
399
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Kanak Sharma
Publisher
πŸ“ˆ
95%
Success Rate