Page 195 - Computer Science Class 11 Without Functions
P. 195

8.

                   if num < 0:
                       print(num, " is a negative number")
                   if num > 0:
                       print(num, " is a positive number")
                   else:
                       print(num, " is zero")
                  Assuming ShtlvnautloflShtlvnrinbatlnum Solbtl10linlShtlcodtlnbovtlntlwtaalntlinltnchloflShtlfoaaowinglcodtltnipptStlI,lII,l
                  nndlIII,ldtStreintlwhichloflShtlcodtltnipptStlwiaalproductlShtltnetlouSpuSlonltxtcuSionlntlShtlnbovtlcodtlwiaalproductl
                  onliStltxtcuSion?
                  I.

                     if num < 0:
                         print(num, " is a negative number")
                     elif num > 0:
                         print(num, " is a positive number")
                     else:
                         print(num, " is zero")


                  II.
                     if num < 0:
                         print(num, " is a negative number")
                         if num > 0:
                             print(num, " is a positive number")
                     else:
                         print(num, " is zero")
                  III.

                     if num < 0:
                         print(num, " is a negative number")
                     if num > 0:
                     print(num, " is a positive number")
                     else:
                     print(num, " is zero")
                  n.l IIlonayl             b. IIlnndlIIIl         c. Ilonayl            d. I,lII,lnndlIII
               9.  WhnSlwiaalbtlShtlouSpuSlproductdlonltxtcuSionloflShtlfoaaowinglcodt?

                 num = 3
                 if (num > 2):
                     num = num * 2
                 if (num > 4):
                     num = 0
                 print(num)
                  n.l 3l                   b. 0l                  c. 6l                 d. Error
              10.  WhnSlwiaalbtlShtlouSpuSlproductdlonlShtltxtcuSionloflShtlfoaaowinglcodt?
                  mass = 0.5
                  itemCount = 10
                  if mass < 2:
                      amount = 1.45



                                                                                          Conditonnal SnStetnSt  193
   190   191   192   193   194   195   196   197   198   199   200