Examples for business, study, careers, love, and more...
Examples :: IT :: Example of If Else Statement

Example of If Else Statement

Also known as if/then in practical applications, the 'if else' concept is a conceptual switch. The logic is that if a precondition applies, then a next step occurs. The statement is essentially a description of options, really much like a flow chart of options. The if else statement is used in many computer basic formats as a logic path.

Examples of If Else Statement:

A very simple set of if else logic:

If a = 123, list X
If a = 234 list Y
If X list anaconda bat cat
If Y list bat cat dog
If anaconda bat cat read line 1
If bat cat dog read line 2