As with other programming languages, one of the most important features in controlling the code process flow is the IF - ELSE statement. The IF - ELSE is a construct which allows the controller to execute statement if the specified condition is true. 

Syntax for IF - ELSE statement

if (condition)
    {
        // code
    }
else
    {
        // code
    }

Example of IF - ELSE statement

 

›› go to examples ››