Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 110 - 2505_CoreGPT(Podar)_Flipbook_C6
P. 110

    ELSE

                           Statements to be executed

                      END IF

                      Program 3: To demonstrate IF-THEN-ELSE statement.

                            NESTED IF STATEMENT

                      The Nested IF in BASIC-256 means placing one IF…THEN statement inside another. It allows the
                      program to make a second decision only when the first condition is true.
                      The syntax of the Nested IF statement is given below:

                      Syntax:
                                                                               Start
                      IF <condition1> THEN

                          Statement 1 to be executed
                                                                                            False
                      ELSE                                                 IF condition 1             Statement 3

                          IF <condition2> THEN
                                                                                   True
                          Statement 2 to be executed
                      ELSE                                                 IF condition 2   False     Statement 2

                          Statement 3 to be executed
                                                                                   True
                      END IF

                      END IF                                                Statement 1

                                                                                Stop

                    108     Premium Edition-VI

| 105 106 107 108 109 110 111 112 113 114 115 |