The if… else construct is used for determinant the flow of program based on returning expression value. It evaluates the comparison operator and based on value executes the statements. for instance, if you would like to execute a bit of code, once the requirements meet then if… else construct verify that piece of code are going to be dead. Else is default condition and executes once no if condition matches. the following example will clear the concept of if… else constructs.

if Example

Leave a Reply

Your email address will not be published. Required fields are marked *