Check out example codes for "shorten if condition c++". It will help you in understanding the concepts better.

Code Example 1

(condition) ? (if_true) : (if_false)

Learn ReactJs, React Native from akashmittal.com