Page 72 - Computer Genius Class 07
P. 72

B.  What will be the output of the following programs?
                        1.  A=12
                           B=14

                           C=18

                           if (A+B>C) and (B+C>A) and (C+A>B):
                           print(“Yes! Triangle can be drawn”)
                        2.  for number in range(0, 10):

                           if number % 3 == 0:
                                print(number)

                        3.  number = 63
                           if number % 3 == 0:

                                if number % 7 == 0:
                                game.splash ("Number is divisible by both 3 and 7")

                                else:
                                game.splash ("Number is divisible by 3 only")

                           elif number % 7 == 0:
                                if number % 3 == 0:

                                game.splash ("Number is divisible by 7 and 3")
                                else:

                                game.splash("Number is divisible by both 7 and 3")
                           else:

                                game.splash ("Number is divisible by neither 7 nor 3")
                        4.  int age = 18:
                           if (age>=18)

                                print(“You are Adult”):
                           else

                                print(“You are Minor”):



                                                                                         Experiential Learning
                     Competency-based/Application-based questions                        Information Literacy
                    1.  Ayaan has created a program in which he declared an array with variables of the integer data type.
                       He needs to remove an item from the array. Which function will he use to do so?
                    2.  Pranjal needs to check if a number is even or odd. Which conditional statement can be used by
                       Pranjal to do so?




                       70    Computer Genius-VII
   67   68   69   70   71   72   73   74   75   76   77