Thursday, March 10, 2011

2.11 Conditional Expressions

  • Conditional expression written with ternary operator " ?:" ( expr1 ? expr2 : expr3 )
  • expr1 is evaluated, if expr1 is true then expr2 is evaluated, otherwise expr3 is evaluated (ie. z = (a > b) ? a : b;       /* z = max (a,b) */ )  

No comments:

Post a Comment