Contents

Which statement is used to select a block of statement is based on the value or variable?
a) if statement                     
b) if-else statement
c) nested if                           
d) switch statement

d

if there is no match the default block of variable is executed is called……
a) if statement                     
b) if-else statement
c) nested if                           
d) switch statement

d

The conditional operator is also known as
a) relational operator
b) binary operator
c) ternary operator 
d) chary operator

c

Explanation: Ternary operator that works with more than two vales


Which of the following keyword is used followed by case statement?
a) colon(:)                            
b) semicolon(;)
c) comma(,)                         
d) equal (=)

a

Which of the following is an invalid if-else statement?
a) if (if (a == 1)) {}             
b) if (a){}
c) if ((char) a) {} 
d) if (func1 (a)) {}

a

Which structure can be enclosed inside another selection structure?
a) if statement                     
b) if-else statement
c) nested if                           
d) switch statement

c