23.Second largest of 3 number using conditional operator
Answers
Answered by
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