Page 102 - TechPluse_C6_Flipbook
P. 102

Relational Operators

                  Relational operators are used to compare the values of two operands and returns Boolean true
                  or false accordingly. The comparison operators are described in the following table:

                   Operator Name          Description                                           Example   Output
                                                                                                (x=8 and
                                                                                                  y=6)
                       =       Equal      It checks if the values of two operands are equal       x = y       FALSE
                                          or not. If yes, then the condition becomes true.
                      <>       Not        It checks if the values of two operands are equal       x <> y      TRUE
                               equal      or not. If the values are not equal the condition
                                          will become true.
                       >       Greater    It checks if the value of left operand is greater        x > y      TRUE
                               than       than the value of right operand. If yes, then the
                                          condition becomes true.
                       <       Less than It checks if the value of left operand is less            x < y      FALSE
                                          than the value of right operand. If yes, then the
                                          condition becomes true.
                      >=       Greater    It checks if the value of left operand is greater       x >= y      TRUE
                               than or    than or equal to the value of right operand. If
                               equal to   yes, then the condition becomes true.

                      <=       Less than  It checks if the value of left operand is less than     x <= y      FALSE
                               or equal   or equal to the value of right operand. If yes,
                               to         then the condition becomes true.


                  Program 5: To use the relational operators.























                  Keywords

                  Keywords are the reserved words which cannot be used as a variable. They are predefined by
                  the software developer for a specific purpose. Some of the keywords are as follows:

                      PRINT    CLS    NEXT        WHILE    FOR    ELSE    END    INPUT



               100      Premium Edition-VI
   97   98   99   100   101   102   103   104   105   106   107