You are on page 1of 7

CONDITIONAL if STATEMENT

Introduction

Conditional statements execute


sequentially when there is no condition
around the statements. If you put some
condition for a block of statements, the
execution flow may change based on the
result evaluated by the condition[1].
FORMAT: Flowchart of
if STATEMENT if STATEMENT
if (condition)
{
statement;
}
FORMAT: Flowchart of
if-else STATEMENT if-else STATEMENT

if (condition)
{
statement;
}
else
{
statement;
}
FORMAT: Flowchart of
nested if STATEMENT nested if STATEMENT
if (condition1)
{
statement;
}
else (condition2)
{
statement;
}
.
.
else
{
statement;
}
Example:
• Write a program that determine if the first
inputted number is greater or lesser or equal
to the second inputted number.
References:

[1]“C Conditional Statement: IF, IF Else and Nested IF Else with Example”. [Online].
Available: https://www.guru99.com/c-if-else-statement.html. [Accessed: 15-Aug.-2020].

You might also like