Lesson 4 – Decision Control

We change our decisions according to changing circumstances. For example, we take an umbrella while going out if there is rain outside. And I would give you more biscuits if you finish these first.

In the examples above the actions are based on some conditions, that are specified after the “if” clause. Similarly, we have decision control structures in C language. One of the most commonly used decision control structure is “if-else”.

Syntax:

If (Condition)

 Statements;

Else

 Statements;

If the condition written with the if clause turns out “True” then the block of statements under if will be executed and if the condition turns out to be false then the block of statements under the if clause will be skipped and statements under else clause will be executed.