If statement / If - else statement in C language
This statement allows decisions to be made evaluating a given condition are true and false. The keyword it tells the compiler that it is a decision control instruction. The condition if is always enclosed within a pair of parenthesis . The relational operators allow us to compare two values to see whether they are equal to each other , greater or less than the other .The general form of if statement is.
•
if ( condition)
{
statement
}
in the above example statement are executed when the condition is true.
•
if ( condition)
{
Statement 1
}
else
{
statement 2
}
in the statement 1 will be executed when the condition is true otherwise Statement 2 will executed.
Comments
Post a Comment
DON'T COMMENT LINK.