Search code examples
c#language-specifications

Isn't "conditional operator" identical to the "ternary operator"?


Regarding C#,

To my understanding the question below is wrong. meaning that a "ternary operator" and a "conditional operator" . Am I Correct?

Question# 6: 10 > 9 ? “10 is greater than 9” : “9 is greater than 10” is an example of _______

  • Ternary operator
  • Conditional operator
  • Greater than operator
  • Inverse operator

Correct Answer: Ternary operator

http://www.tutorialsteacher.com/online-test/view-answer?test=csharp&que=6


Solution

  • The correct answer is "Conditional Operator" ( which happens to be the only ternary operator so often gets called that ) as that's what the language reference calls it.

    https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/conditional-operator