Conditional Operator:
Conditional Operator is used to check a condition and Select a Value depending on the Value of the condition.Variable = (condition)? Value 1 : Value 2:
If the Value of the condition is true then Value 1 is e valued assigned to the varable, otherwise Value2.
Eg:
big = (a>b)? a:b;
This exxp is equal to
if (a>b)
big = a;
else
big = b;
0 comments:
Post a Comment