4. C Conditional Operators
• They are also called as Ternary Operator .
• They also called as ( ?: ) operator
• Ternary Operators takes on 3 Arguments
Syntax:
expression 1 ? expression 2 : expression 3
Copyrights By Tanveer Malik
5. C Conditional Operators
where
• expression1 is Condition
• expression2 is Statement Followed
if Condition is True
• expression2 is Statement Followed
if Condition is False
Copyrights By Tanveer Malik
7. Meaning of Syntax
• Expression1 is nothing but Boolean Condition i.e it
results into either TRUE or FALSE.
• If result of expression1 is TRUE then expression2 is
Executed.
• Expression1 is said to be TRUE if its result is NON-ZERO.
• If result of expression1 is FALSE then expression3 is
Executed.
• Expression1 is said to be FALSE if its result is ZERO.
Copyrights By Tanveer Malik