Computer Science, asked by sumitarout7026, 5 months ago

c) Re-write the following code snippet using ternary operator:
if (a>b)
if (a>c)
m=a
else
m=c;
else
if(b>c)
m=b
else m=c;​

Answers

Answered by BrainlyProgrammer
1

Question: Convert if-else to ternary operator

Answer:

m=(a>b)? (a>c)? a : c) : (b>c)? b : c;

Answered by anindyaadhikari13
1

Answer:-

Using ternary operator, we can write like this,

m=(a>b)?((a>c)?a:c):((b>c)?b:c);

Similar questions