conditional ternary operator c++ code example
Example 1: shorten if condition c++
(condition) ? (if_true) : (if_false)
Example 2: ternary operator in c++
(n1 > n2) ? n1 : n2;
OR
n1 > n2 ? n1 : n2;
(condition) ? (if_true) : (if_false)
(n1 > n2) ? n1 : n2;
OR
n1 > n2 ? n1 : n2;