When I run the program it shows the middle number but the condition is not satisfied like the last condition with the two numbers are equal. Thanks in advance.
package com.codegym.task.task04.task0441;
/*
Somehow average
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String zahl = reader.readLine();
int a = Integer.parseInt(zahl);
BufferedReader readertwo = new BufferedReader(new InputStreamReader(System.in));
String zahlzwei = readertwo.readLine();
int b = Integer.parseInt(zahlzwei);
BufferedReader readerthree = new BufferedReader(new InputStreamReader(System.in));
String zahldrei = readerthree.readLine();
int c = Integer.parseInt(zahldrei);
if(a<b && c>b)
System.out.println(b);
else if(b>a && c>b)
System.out.println(b);
else if(a>b && a>c)
System.out.println(a);
else if(a>c && a<b)
System.out.println(a);
else if(c>b && c<a)
System.out.println(c);
else if(c>a && c<b)
System.out.println(c);
else if(a==b && a==c)
System.out.println(a);
else if(a==b)
System.out.println(a);
else if(a==c)
System.out.println(a);
else if(c==b)
System.out.println(c);
}
}