Computer Science Objective Questions and Answers: Flow of control conditional statements
Access targeted multiple-choice questions for Flow of control conditional statements designed to align with the latest CBSE academic syllabus for Class 12 Computer Science. These objective practice sets help students evaluate their conceptual understanding and improve exam readiness.
Download Flow of control conditional statements MCQs with Answers
Navigate directly to the 50 objective questions for Flow of control conditional statements using the digital viewer below. Each practice set includes verified answer keys, allowing students to instantly cross-check their work and identify areas requiring further revision.
Question. Which one of the following is a valid Python if statement :
a. if a>=2 :
b. if (a >= 2)
c. if (a => 22)
d. if a >= 22
Answer : A
Question. What will be the output of the following Python code?
list1 = [3 , 2 , 5 , 6 , 0 , 7, 9]
sum = 0
sum1 = 0
for elem in list1:
if (elem % 2 == 0):
sum = sum + elem
continue
if (elem % 3 == 0):
sum1 = sum1 + elem
print(sum , end=” “)
print(sum1)
a. 8 9
b. 8 3
c. 2 3
d. 8 12
Answer : D
Question. Predict the output of the following code:
X=3
If x>2 or x<5 and x==6:
Print(“ok”)
else:
print(“no output”)
a . ok
b. okok
c. no output
d. none of above
Answer : C
Question. What will be the output of given Python code?
str1=”hello”
c=0
for x in str1:
if(x!=”l”):
c=c+1
else:
pass
print(c.
a. 2
b. 0
c. 4
d. 3
Answer : D
Question. The ……………… statement forms the selection construct in Python.
a. If else if
b. if
c. For ;
d. for
Answer : B
Question. The ………….statement terminates the execution of the whole loop.
a. continue
b. exit
c. breake
d. break
Answer : D
Question. The order of statement execution in the form of top to bottom is known as construct.
a. alternate
b. sequence
c. flow of data
d. flow chart
Answer : B
Question. Name is rohit and age between 18 and 35
a. name==rohit and age >=18 and age<=35
b. name==rohit and age >=18 or age<=35
c. name==rohit or age >=18 and age<=35
d. none
Answer : C
Question. Does python have switch case statement?
a. True
b. False
c. Python has switch statement but we can not use it.
d. None of the above
Answer : B
Question. if the condition is …………. , the statements of if block will be executed otherwise the statements in the ……….. block will be executed
a. false, true
b. true, else
c. both options are true
d. Can’t say
Answer : B
Question. Mala wants to make a fun program , if user enters any number a Good or funny message will appear . She is confused that which is the most suitable control to be used to make such program. Help her to choose correct option.
a. If
b. if else
c. if elif
d. Nested if else
Answer : B
Question. What does the following code print to console.
if True:
print(1001)
else:
print(2002)
a. 1001
b. true
c. 2002
d. false
Answer : A
Question. Predict the output of the following code:
x,y=2,4
if(x+y= =10):
print(“true”)
else:
print(“false”)
a. true
b .false
c. no output
d. none
Answer : B
Question. What does the following Python program display ?
x = 3
if x == 0:
print (“Am I here?”, end = ‘ ‘)
elif x == 3:
print(“Or here?”, end = ‘ ‘)
else :
pass
print (“Or over here?”)
a. Am I here?
b. Or here?
c. Am I here? Or here?
d. Or here ?
Or over here?
Answer : D
Question. An ……………… statement has less number of conditional checks than two successive ifs.
a. If else if
b. if elif
c. if-else
d. none
Answer : C
Question. The break and continue statements, together are called …………….statement.
a. Jump
b. goto
c. compound
d. none
Answer : B
Question. Donation in the range of4000-5000 or guest=1
a. (donation>=4000 and donation<=5000) or guest==1
b. donation>=4000 or donation<=5000 or guest==1
c. donation>=4000 and (donation<=5000 or guest==1)
d. donation>=4000 and donation<=5000) or guest==1
Answer : A
Question. Which statement will check if a is equal to b?
a. if a == b:
b. if a = b:
c. if a === c:
d. if a == b
Answer : A
Question. What will be the output of the following program if we input 8
Ch= int (“Enter Day of week (1 to 7 “))
If ch==1:
print (“Monday”)
elif ch==2:
print (“Tuesday”)
elif ch==3:
print (“Wednesday”)
elif ch==4:
Page 38 of 55
print (“Thursday”)
elif ch==5:
print (“Friday”)
elif ch==6:
print (“Saturday”)
else:
print (“Sunday”)
a. Sunday
b. Monday
c. All days will be printed
d. No Output
Answer : D
Question. What will be the output of the following Python code?
If 4+5==10:
print(“TRUE”)
else:
print(“false”)
print (“True”)
a. False
True
b. True
True
c. false
d. none
Answer : B
Question. Consider the following code segment:
a = int(input(“Enter an integer: “))
b = int(input(“Enter an integer: “))
if a <= 0:
b = b +1
else:
a = a + 1
if a > 0 and b > 0:
print (“W”)
elif a > 0:
print(“X”)
if b > 0:
print(“Y”)
else:
print(“Z”)
What letters will be printed if the user enters -1 for a and -1 for b?
a. Only W
b. Only X
c. Only Y
d. Only Z
Answer : D
Question. if( a. :
print(“a is non zero”)
else:
print(“its results is True”)
a. false
b. True
c. Its result is True
d. a is nonzero
Answer : D
Question. The ……….. operator tests if a given value is contained in a sequence or not.
a. In:
b. in
c. not in
d. none
Answer : B
Question. A graphical representation of an algorithm to solve a problem is called ……………
a. flow of data
b. barchart
c. flow chart
d. none
Answer : C
Question. State which of the following statement are true .
1.If,elif ,else are not compound statement.
2.Else if can be used in python.
3.Indentation while working with blocks is not necessary in python.
4.A pass statement is a null operation;it does nothing.
a.1
b. 2 ,3
c. 3
d. 4
Answer : D
Question. Checking multiple conditions in python requires……….. statement
a. if
b. if……. elif
c. switch
d. None of these
Answer : B
Question. What will be output after execution of the following code?
a=11
b=5
if (a%b==0):
print ( “Greater”)
if (a//b==0):
print ( “Example”)
else
print (“Sooo Sorry”)
a. Sooo Sorry
b. Great
c. Example
d. Great Example
Answer : B
Question. What keyword would you use to add an alternative condition to an if statement?
a. else if
b. elseif
c. elif
d. None of the above
Answer : C
Question. If the user inputs : 2<ENTER>, what does the following code snippet print?
x = float(input())
if(x==1):
print(“Yes”)
elif (x >= 2):
print(“Maybe”)
else:
print (“No”)
a.Yes
b. No
c. Maybe
d. Nothing is printed
Answer : C
Question. The……….. clause can occur with an if as well as with loops.
a. else
b. break
c. continue
d. none
Answer : A
Question. The two membership operators are ……….and …………
a. in, not in
b. true , false
c. =,==
d. none
Answer : A
Question. In a Python program, a control structure:
a. Defines program-specific data structures
b. Directs the order of execution of the statements in the program
c. Dictates what happens before the program starts and after it terminates
d. None of the above
Answer : B
Question. What will be output after execution of the following code?
a=11
B=5
If(a//b==2):
Print (“Yes”)
else :
Print(“No”)
a. 2.5
b. Yes
c. No
d. 21
Answer : B
Question. Which of following is not a decision-making statement.
a. if-elif statement
b. for statement
c. if -else statement
d. if statement
Answer : B
Question. Which one of the following if statements will not execute successfully?
if (1, 2) ;
print(‘foo’)
if (1, 2) :
print(‘foo’)
if (1) :
print( ‘foo’ )
if (1) ;
print( ‘foo’ )
a. 1 ,4
b. 2
c. 2,4
d. 4
Answer : B
Question. What is the logical expression for the following
Either A is greater than B or A is less than C
a. A>B or A<C
b. A>B and A<C
c . A>Band C
d. A>B or C
Answer : A
Question. What will be output of this expression:
‘p’ + ‘q’ if ’12’.isdigit() else ‘r’ + ‘s’
a. pq
b. rs
c. pqrs
d. pq12
Answer : B
Question. What will be the output of the following Python code?
str1=”learn python”
str2=””
str3=””
for x in str1:
if(x==”r” or x==”n” or x==”p”):
str2+=x
pass
if(x==”r” or x==”e” or x==”a”):
str3+=x
print(str2,end=” “)
print(str3)
a. rnpn ea
b. rnpn ear
c. rnp ea
d. rnp ear
Answer : B
Question. In Python, …………………. defines a block of statements.
a. Block
b. loop
c. indentation
d. {}
Answer : C
Question. An empty /null statement in Python is …………….
a. pass
b. none
c. null
d. none
Answer : A
Free study material for Computer Science
Multiple Choice Questions (MCQs) for Class 12 Computer Science Flow of control conditional statements
Chapter MCQs with Answers for Class 12 Computer Science
Review structured objective questions for Class 12 Computer Science Flow of control conditional statements. Built according to official CBSE guidelines, these MCQ sets support daily revision and core concept reinforcement.
Expert Practice Material for Class 12 Computer Science
Each question includes structured solution keys mapped directly to standard CBSE textbooks, helping students evaluate their reasoning and correct mistakes early in their revision.
Complete Your Chapter Revision
Explore our broader library of printable assignments, chapter notes, and mock tests designed to support continuous revision and secure higher marks in CBSE assessments.
FAQs
You can get most exhaustive CBSE Class 12 Computer Science Flow of control conditional statements MCQs for free on StudiesToday.com. These MCQs for Class 12 Computer Science are updated for the 2026-27 academic session as per CBSE examination standards.
Yes, our CBSE Class 12 Computer Science Flow of control conditional statements MCQs include the latest type of questions, such as Assertion-Reasoning and Case-based MCQs. 50% of the CBSE paper is now competency-based.
By solving our CBSE Class 12 Computer Science Flow of control conditional statements MCQs, Class 12 students can improve their accuracy and speed which is important as objective questions provide a chance to secure 100% marks in the Computer Science.
Yes, Computer Science MCQs for Class 12 have answer key and brief explanations to help students understand logic behind the correct option as its important for 2026 competency-focused CBSE exams.
Yes, you can also access online interactive tests for CBSE Class 12 Computer Science Flow of control conditional statements MCQs on StudiesToday.com as they provide instant answers and score to help you track your progress in Computer Science.