Rewrite the snippet using ternary operation
if(a>b)
d=(a-b);
else
d=(b-a);
Answers
Answered by
1
it maybe n the ofsm nu .
Answered by
2
Answer:SYNTAX
variable=condition?exp1:exp2
Explanation:
VARIABLE=d
condition=a>b
exp1=a-b(if true)
exp2=b-a(if false)
so in terms of ternary operator
answer is
d = a>b? a-b : b-a;
Similar questions