Page 295 - Computer Science V2.0 Class 11
P. 295

elif num%3 == 0:
                              num = num +2
                          print(num)
                      (iv)  r=0
                          s=5
                          t=12
                          if s>0:
                              if r<0:
                                  r=r+5
                              elif t>0:
                                  r=r+4
                              else:
                                  r=r+2
                          else:
                              r=r+3
                          print (r)

                      (v)  result=False
                          a=None
                          if a==result:
                                print ("Same Same")
                          else:
                                print ("Not Same")

                      (vi)  x=5
                          y=10
                          if x**2>100 and y<100:
                              print (x, y)

                      (vii)  a,b=50,100
                          if a+b:
                              print ("TRUE")
                          else:
                              print ("FALSE")

                      (viii) if True:
                              print ("Hey")
                          else:
                              print ("Hi")
                 E.  Unsolved Programming Questions
                    1.  Write a program to read two numbers and print smaller of the two numbers.
                    2.  Write a program to read three numbers and print the smallest of these three numbers.
                    3.  Write a program to read four numbers and print the smallest of these four numbers.
                    4.  Write a program to arrange three numbers in descending order.
                    5.  Write a program to read a pair of numbers and check whether the first number is a multiple of the second. Your output
                      should appear as follows:
                          30 is a multiple of 5
                          30 is not a multiple of 7




                                                                                               Conditional Statements  281
   290   291   292   293   294   295   296   297   298   299   300