C++ Ternary Basics clear

Last tutorial we have seen about ternary

But the question is why we use ternary ?

the same we can write like this

or like this

So the syntax is:

Just like the if else paradology

Code: