Page 286 - Computer Science V2.0 Class 11
P. 286
11. What will be the output of the following code if user provides 45 as the input :
number = int(input("Enter a number : "))
if number%2 != 0 and number%3 == 0:
print("Odd Multiple of 3")
else:
print("Not Odd Multiple of 3")
a. Error
b. No output
c. Odd Multiple of 3
d. Not Odd Multiple of 3
12. What will be the output of the following code if user provides 21, 25 and 29 as the input arguments to the call to the
function find:
def find(num1, num2, num3):
if num1 < num2:
if num2 < num3:
print(num3)
else:
if num1 < num3:
print(num2)
else:
print(num2)
else:
if num3 < num2:
print(num1)
else:
if num3 < num1:
print(num1)
else:
print(num3)
a. 21 b. 25 c. 29 d. Error
B. State whether the following statements are True or False:
1. By default, the statements in a program are executed sequentially. __________
2. if – elif statement is a compound statement. __________
3. The statements in a suite (block) are at the same indentation level. __________
4. Every compound statement has a header clause. __________
5. In if-else statement, the indented sequence of statements in the if suite (also called, if block)
will be executed when the conditional expression yields False. The else suite (also called
else block) will be executed when the conditional expression yields True. __________
6. elif clause is more suited for the scenarios when different actions are required to be executed
depending on the value of a variable. __________
C. Fill in the blanks.
1. When we execute a program, the order of execution of statements is in the same order as given in the program. This is the
______________ flow of control in a program.
2. In the case of conditional flow, the execution of the statements depends upon a ______________.
3. In the case of iterative flow, a sequence of statement(s) is executed ______________ times.
272 Touchpad Computer Science (Ver. 2.0)-XI

