If Statement
If Control Structure
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
}