Question 12 of 16beginner🧠 RememberShort Answer2 marks

What are conditionals? When they are required in a program?

Correct Answer

Conditionals are used to check possibilities in a program. The program checks one or more conditions and performs operations (sequence of actions) depending on the true or false value of the condition. These true or false values are called binary values.

Conditionals are required in a program when there are situations where we need to take action based on whether a condition is fulfilled or not. For example, checking eligibility for voting based on age, or determining if a number is odd or even. In such cases, any one of the alternatives is selected based on the outcome of a condition. In programming languages, conditionals are written using if-else blocks.

Exercise: EXERCISE | Q: 12 | (Page 24)
For More Understanding

Explanation

The answer draws directly from the textbook context which defines conditionals as constructs that 'check possibilities' and allow programs to 'perform operations depending on true or false value of the condition.' The context provides clear examples (voting eligibility, odd/even numbers) showing when conditionals are needed - specifically when decision-making depends on certain conditions and different actions must be taken based on whether conditions are fulfilled or not.