public static int getMedium(int a, int b, int c) { if (c <= b & b <= a) return b; else if (a <= b & b <= c) return b; else if (b <= c & c <= a) return c; else if (a <= c & c <= b) return c; else if (b <= a & a <= c) return a; else if (c <= a & a <= b) return a; else return 0; } }