Conditional Operator:
The operator which is used to evaluate conditions, called
Conditional Operator.
The following is Conditional operator.
? :
General format of Conditional operator
Here: expression _ 1 contains a condition. expression _2 and
expression _3 contains values.
If the condition is true expression _2 gets executed.
Otherwise expression _3 gets executed.
Z = (x >= y) ? x: y ;
If the condition is true z = x otherwise z =y.
Let x =15 and y =10;
Since the condition is true, z value will be x i.e., 15
Let x =10 and y =25;
Since the condition is false z value will be y i.e., 25