IF statement:
If the conditional expression given in the parenthesis is true, then the statements within the block will be executed, followed by execution of the remaining program. If the conditional expression evaluates to false, then the statement block will not be executed. Note that if statement block constitutes a single statement, then drawing curly brackets is optional.
Syntax:
if(condition)
{
statement block;
}
If else statement :
If the conditional expression evaluates to true, then true block statements will be executed otherwise false block that is the else part will be executed. At a time either true block or false block will be executed, not both.
Syntax :
if(condition)
{
statement block;
}
else
{
statement block;
}
{
statement block;
}
else
{
statement block;
}
Thanking you bro
ReplyDelete