Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 107 - 2620_Birla Open Mind C-8
P. 107

    A.    Choose the correct option.

                            1.   The result of the computer’s decision for a                 will always be either true or false.

                                     a.  loop                                      b.  condition

                                     c.  Both a. and b.                            d.  None of these

                            2.  A loop is used to execute instructions or a block of code                times.

                                     a.  two                                       b.  three

                                     c.  multiple                                  d.  infinite

                            3.  What is an endless loop called?
                                     a.  Counting loop                             b.  Conditional loop

                                     c.  Infinite loop                             d.  None of these

                            4.  Which condition results true if both conditions are true?

                                     a.  AND                                       b.  OR

                                     c.  Both a. and b.                            d.  None of these

                     B.    Answer the following questions:

                               1.  What is a loop?

                               2.  Write the difference between the following with an example of each:
                                  a.  AND condition and OR condition

                                  b.  counting loop and a conditional loop

                               3.  Write an if condition to display “Yes” or “No” if it is Sunday today and a cricket match also.

                               4.  Write an if condition to display “Yes” or “No” if it is a weekday today or your exam.

                               5.   Write a program to check whether a given number is negative or positive. If the number is positive,
                                  then print “Positive number”. If the number is negative, then print “Negative number”.

                                                                                                 #Algorithmic Intelligence 105

| 102 103 104 105 106 107 108 109 110 111 112 |