Page 90 - Computer Genius Class 06
P. 90

Relational Operators
                   elational operator chec s the  alue o  the t o operands.

                   elational operator returns
                     1  i  the  alue is true.

                        i  the  alue is  alse.

                  Types of relational operators:


                     Symbol                Operator                          Description                 Example

                       ==         ual to                          a is e ual to  .                         a

                                 ot e ual to                      a is not e ual to  .                     a


                        >       Greater than                      a is greater than  .                     a

                        <       Less than                         a is less than  .                        a

                       >=        reater than or e ual to          a is greater than or e ual to  .         a

                       <=        ess than or e ual to             a is less than or e ual to  .            a



                  Nested Conditional Statements

                   ou may come across comple  scenarios in using a single i  else loop might not  e enough.  n that
                  case you need to use nested conditional statement.

                     there is another i  else construct  ithin the i   loc  or the else  loc   this is called nesting or
                  nested i  else.
                  Example 1:  To chec  i  a num er is di isi le  y 2 or   or  y  oth 2 and  .

                  Solution:
                   hange the   um er  to  1    in  set  um er   loc   and clic  on  on start   loc   the output  ill  e



























                       88    Computer Genius-VI
   85   86   87   88   89   90   91   92   93   94   95