Basic HTML Version

|  | Table of Contents |  | View Full Version

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

    Program 3: To use the arithmetic operators.

                      Logical Operators

                      Logical operators are used primarily in the expression evaluation to make a decision. Basic-256
                      supports the following logical operators:

                                                                                                Example
                       Operator Name Description                                                                 Output
                                                                                             (x=3 and y =7)
                          and       AND  It returns true, if both operands are true.       (x < 5) and (y < 10)    TRUE

                           or        OR     It returns true, if one of the operands is true. (x < 5) or (y < 2)    TRUE

                          not       NOT     Reverses the logical state of its operand.     NOT x                  FALSE
                                            Performs a logical exclusion on two
                          xor       XOR                                                    x XOR y                FALSE
                                            expressions.

                      Program 4: To use the logical operators.

                     98     Premium Edition-VI

| 95 96 97 98 99 100 101 102 103 104 105 |