Computer Science, asked by harini0611, 1 year ago

syntax for conditional operator

Answers

Answered by sharma0001
3
CONDITIONAL OR TERNARY OPERATORS IN C:Conditional operators return one value if condition is true and returns another value is condition is false.This operator is also called as ternary operator.Syntax     :        (Condition? true_value: false_value);Example :         (A > 100  ?  0  :  1);In above example, if A is greater than 100, 0 is returned else 1 is returned. This is equal to if else conditional statements.
Answered by Aryamohanan23
2
expression 1 ? expression 2 : expression 3

where

expression1 is Condition
expression2 is Statement Followed if Condition is True
expression3 is Statement Followed if Condition is False
Similar questions