The program should display the middle number of the three numbers.
RECOMMENDATION FROM YOUR MENTOR
Test the program with the numbers 1, 3, and 2. Expected output: 2
package com.codegym.task.task04.task0441;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
Scanner ob=new Scanner(System.in);
int a = ob.nextInt();
int b = ob.nextInt();
int c = ob.nextInt();
if(a==c || a==b)
System.out.println(a);
else if (b==c)
System.out.println(b);
else if(a>b && b>c || c>b && b>a)
System.out.println(b);
else if(b>a && a>c || c>a && b>a)
System.out.println(a);
else if(a>c && c>b || b>c && c>a)
System.out.println(c);
}
}