Single Choice Moderate

QTernary operator ? : is:

ID: #25981 MCQ Quiz - Class 8 - Decision Control Structure 5 views
Question Info
#25981Q ID
ModerateDifficulty
MCQ Quiz - Class 8 - Decision Control StructureTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Shorthand conditional
  • B Loop
  • C Function
  • D Class
Correct Answer

Explanation

Correct Answer Explanation:

The ternary operator (?:) is a concise version of if-else. Syntax: condition ? valueIfTrue : valueIfFalse.

Why the other options are incorrect:

  • Option B: It's not a loop.
  • Option C: It's not a function definition.
  • Option D: It's not a class definition.

Share This Question

Challenge a friend or share with your study group.