An ___ statement has less number of conditional checks than two successive ifs

34. An ___ statement has less number of conditional checks than two successive ifs.

  1. if else if
  2. if elif
  3. if-else
  4. None of the mentioned above

Answer: C) if-else

Explanation:

A single if-else statement requires fewer conditional checks than two consecutives if statements. If the condition is true, the if-else statement is used to execute both the true and false parts of the condition in question. The condition is met, and therefore the if block code is executed, and if the condition is not met, the otherwise block code is executed.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.