###Strange return value###
Strange return value
Why does find_second() ever return -1? That function should actually find the second value, even if it had to loop three times within the function to do so. It doesn't make sense to call it three times from main().
###Minimal comparisons###
Minimal comparisons
Most of the other answers gave alternate solutions where you had to do four comparisons followed by some math operations. The minimal solution requires only three comparisons, and can sometimes return after two. It also doesn't need any other math operations:
int find_second(int a, int b, int c)
{
if (a > b) {
if (c > a)
return a;
if (b > c)
return b;
} else {
if (c > b)
return b;
if (a > c)
return a;
}
return c;
}