Here is a nice little tip for using a shorthand if function, best used when the true and false actions are small one liners such as assigning or outputing a value.
Syntax
(boolean condition) ? ifTrueDoThis : ifFalseDoThis ;
Example….
int a( 5); int b (9); (a>b) ? cout << a : cout <<b;
Output
9
