CPP Conditional Operator MCQ

Cpp MCQ
  1. Home
  2. Tutorials
  3. Cpp
  4. Conditional Operator
  5. Multiple Choice Question

(1) Which of the following operator is used to separate multiple statements in True or False case of conditional operator ?

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

(2) Conditional operator can be also be used in:

A) Assignment Statement
B) Expression
C) Both A and B
D) None

(3) Which of the following parentheses are used to execute multiple statements in True or False case of conditional operator ?

A) ( )
B) { }
C) [ ]
D) None

(4) Which of the following is optional in Ternary operator statement ?

A) Condition
B) True Case
C) False Case
D) All Mandatory

(5) Which of the following is correct syntax of conditional operator?

A) (condition) : True ? False
B) (condition) ? True : False
C) (condition) : True : False
D) (condition) ? True ? False

(6) True case in conditional operator is written after which symbol?

A) ?
B) :
C) ()
D) ;

(7) Conditional operator is also called _______ operator.

A) Unary
B) Binary
C) Ternary
D) None

(8) Which of the following operators are used as conditional operator ?

A) ? :
B) > >
C) : :
D) /*

(9) Conditional operator is good alternative of.

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