How does the 'ternary' operator (?:) work in C?

  • It defines a function in C
  • It performs bit-level operations
  • It's used for binary arithmetic
  • It's used to create a conditional expression
The 'ternary' operator in C, represented as '?:', is a shorthand way to write a simple conditional expression. It allows you to return one of two values based on a condition.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *