Computer Science, asked by anjanagorainoffice, 16 days ago

23.Second largest of 3 number using conditional operator

Answers

Answered by 4264
0

Answer:

You can get the second largest of 3 numbers (a,b and c) using the ternary operator as follows:

int x = (a >= b && a >= c) ? ((b >= c) ? b : c) :

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

Similar questions