Xii Computer Conditions
Xii Computer Conditions
If else If else statement is used to execute a code when condition is true otherwise it
statements execute another code in else section
If else if If else ladder is used, If we want to check for multiple conditions one after
ladder another
If statement in C Programming.
The if statement in C programming language is used to execute a block of code only if condition
is true. The if statement checks whether conditional expression is true or false. If the conditional
expression is true, then the block of code inside the if statement is executed but if conditional
expression is false, then the block of code inside the if statement is ignored and the next statement
after if block is executed.
Syntax of If Statement
if(conditional expression)
{
/* code to be execute if the conditional expression is true */
statements;
}
Note: Opening and Closing Braces are optional, if the block of code of if statement contains
only one statement and no statement terminator ; at the end of if(condition)