R else if statementThis statement is also known as nested if-else statement. The if statement is followed by an optional else if..... else statement. This statement is used to test various condition in a single if......else if statement. There are some key points which are necessary to keep in mind when we are using the if.....else if.....else statement. These points are as follows:
The basic syntax of If-else statement is as follows: Flow Chart Example 1Output: Example 2Output: Example 3Output: Example 4Output: Example 5Output:
Next TopicR Switch Statement
|