Write down about the nested if-else statement

Nested if...else statement:

When a series of decisions are involved, we may have to use more than one if-else statement in nested form as shown below,








ContentMiddleAd

Here, if the condition 1 is false then it skipped to statement 3. But if the condition 1 is truethen it tests condition 2. If condition 2 is true then it executes statement 1 and if false then it executes statement 2. Then the control is transferred to the statement x. This can also be shown by the following flowchart,




Author: Tanmay Chakrabarty

Tanmay Chakrabarty is a former CSE student, currently working as a Senior Software Engineer with 5+ years of experience in the field of Web Application development in PHP+MySQL platform with strong skills in Javascript, JQuery, JQuery UI and CSS. He tries to write notes every week but fails due to heavy loads of duty.

Recommended Recommends

Comments

Contact Us