February 23, 2025

Telugu Tech Tuts

TimeComputers.in

C Tutorial In Telugu If Else Part 8

An if statement can be followed by an optional else statement, which executes when the boolean expression is false.
Syntax:

The syntax of an if…else statement in C programming language is:

if(boolean_expression)
{
/* statement(s) will execute if the boolean expression is true */
}
else
{
/* statement(s) will execute if the boolean expression is false */
}

If the boolean expression evaluates to true, then the if block of code will be executed, otherwise else block of code will be executed.

C programming language assumes any non-zero and non-null values as true, and if it is either zero or null, then it is assumed as false value.