Computer Science, asked by shadowkingt0321, 1 month ago

covert “if” statement into “ternary operator”

if (a>b)

max=a;

else

max=b;

Answers

Answered by BrainlyProgrammer
1

 \red \dag \sf Answer \\ \orange{ \sf \: max =(a > b)?a: b; }

Wanna know facts?

  • Ternary operator is also known as Conditional Operator.
  • Syntax: variable=(condition)? expression 1: expression 2;

Similar questions