Contents

How many times is the test expression of as witch statement evaluated?
a) 0           
b) 1   
c) 2        
d) once for each code

b

The code under this statement is executed when the input does not match to any case in switch statement……
a) break                                
b) case
c) default                              
d) switch

b

Which of the following are valid case statements in a switch?
a) case 1:                              
b) case x<4:
c) case ‘ab’                          
d) case 1.5:

a

Which of the following is used when program requires more than one test expression?
a) if                                        
b) switch
c) nested if ….else              
d) break

c

What is the output of expression (x>y? x*y : x+y) where x=10, y=5?
a) 5                        
b) 10                      
c) 15                      
d) 50

d

What is the output of expression (a>b? a-b : a+b) where a=15, b=10?
a) 15      
b) 25                      
c) 5                        
d) 150

c