Which statement is NOT correct regarding ternary operator in C++?
20212021
Which statement is NOT correct regarding ternary operator in C++?
- A.
Its symbol is ?:
- B.
It is also known as conditional operator
- C.
Operator overloading is possible in it
- D.
It is similar to if else
Attempted by 124 students.
Show answer & explanation
Correct answer: C
The ternary operator in C++ is represented by ?: and is also called the conditional operator. It behaves similarly to an if-else statement by evaluating a condition and selecting one of two expressions.
In C++, the ternary operator cannot be overloaded. Therefore, the statement “Operator overloading is possible in it” is NOT correct.