Page 140 - TP_Plus_v4_Class7
P. 140

21 st
                     Scratch Your Brain.                                                          Century   #Critical Thinking
                                                                                                    Skills
                     1.  What will be the output of the following programs?

                         a.  a = 200
                            b = 33

                            if (b > a):

                              print("b is greater than a")
                            else:

                              print("b is not greater than a")
                         b.  x = 10


                           y = 5
                           if (x > 5):
                               print("x is greater than 5")

                               if (y > 2):

                                   print("y is greater than 2")
                               else:

                                   print("y is not greater than 2")
                          else:

                               print("x is not greater than 5")
                         c.  num = 3.4
                            if (num > 0):

                                print("Positive number")

                            elif (num == 0):
                                print(“Zero”)

                            else:

                                print("Negative number")
                         d.  x = 31

                            if (x > 10):

                              print("Above ten")
                              if (x > 20):

                                print("and also above 20!")

                              else:
                                print("but not above 20.")






                  138  Plus (Ver. 4.0)-VII
   135   136   137   138   139   140   141   142   143   144   145