CPP Switch Statement MCQ

CPP MCQ
  1. Home
  2. Tutorials
  3. CPP
  4. Switch Statement
  5. Multiple Choice Question

(1) What will happen if we miss break statement after true case of switch statement ?

A) Compiler will generate error
B) Switch will not execute
C) Remaining case will not match
D) Default statement will not execute

(2) Which of the following is used after case keyword?

A) Variable
B) Constant
C) Expression
D) Operator

(3) How many case statements are allowed before single break statement in switch statement?

A) Only one
B) Maximum two
C) 4
D) Multiple

(4) Which of the following operator is used after case keyword in switch statement?

A) : (colon)
B) ; (Semi colon)
C) , (comma)
D) . (dot)

(5) default statement is ____________ in switch statement.

A) Mandatory
B) Optional
C) Enforced
D) None of these

(6) Which of the following symbol is used after case keyword in switch statement ?

A) :
B) ;
C) .
D) ,

(7) Which of the following expression used by switch statement ?

A) Arithmetic
B) Relational
C) Logical
D) All

(8) switch statement is good alternative of

A) if
B) if else
C) if else if
D) nested if
Comments
Login to TRACK of Comments.