Mam napisać program wybierający 2-gą co do wielkości liczbę z 3 liczb. Dla przykładu: 2 3 4 ma wyświetlić 3. Nie wiem dlaczego, mi wyświetla 2 .. Mógłby ktoś to wytłumaczyć?
#include <stdio.h>
#include <stdlib.h>
int max2(int a, int b, int c)
{
if((a > b && a < c) && (b < c)) return a;
if((b > a && b < c) && (a < c)) return c;
if((c > b && c < a) && (b < c)) return b;
}
int main()
{
printf("%d\n", 2, 3, 4);
return 0;
}