Implementing ternary operator without any conditional statement
How to implement ternary operator in C++ without using conditional statements.In the following condition: a ? b: c If a is true, b will be executed. Otherwise, c will be executed.We can assume a, b and c as values. 1. Using Binary Operator We can code the equation as : Result = (!!a)*b + (!a)*c In a