Search your topic here

PPL: Conditional Statements

CONDITIONAL STATEMENTS

MCQs on Conditional Statements

Q1. How many choices are possible when using a single if-else statement?
a) 1
b) 2
c) 3

Q2. Which of the following are incorrect statements? If int a=4
1) if( a==4 )   
2) if( 4==a )   
3) if( a=4   )   
4) if( 4=a   )
a) 3 and 4.
b) 3 only.
c) 4 only.

Q3. If the variable count exceeds 4, a single statement that prints “Too many” is
a) if (count<< “Too many”
b) if (count>4) cout >> “Too many”
c) if (count>4) cout << “Too many”

Q4. Which of the following must be present in switch construct? 
a) Expression in ( ) after switch 
b) default 
c) case followed by value 

Q5. A switch construct can be used with which of the following types of variable? 
a) int 
b) int, char 
c) int, float, char 


MCQs Answers   

Q1. (b)
Q2. (c)
Q3. (c)
Q4. (a)
Q5. (b)

LEAVE A REPLY