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.
Loading...
Related Quiz
- You are designing a C program to handle a database of employees in a company. Each employee has attributes like name, ID, and salary. What would be an efficient way to manage this data?
- When a function receives a pointer as an argument, it can modify the ________ that the pointer points to.
- How can a dangling pointer issue be avoided after freeing memory in C?
- What is the return type of the strlen function in C?
- Using pointers to structures can lead to more efficient use of ________.