If Statement
IF Statement
This is the simplest form of branching statement. When we have only one condition to evaluate, we should use this statement. It performs a course of action if the condition evaluates to true, otherwise, it ignores the action.
Syntax:
if(conditional expression)
{
Statement 1;
Statement 2;
……….
Statement n;
}
IF Statement
This is the simplest form of branching statement. When we have only one condition to evaluate, we should use this statement. It performs a course of action if the condition evaluates to true, otherwise, it ignores the action.
Syntax:
if(conditional expression) { Statement 1; Statement 2; ………. Statement n; }