Answer:
The code is in java.
Step-by-step explanation:
import java.util.Scanner;
class Main{
public static void main(String[] args) {
System.out.println("Enter 3 different numbers");
Scanner obj = new Scanner(System.in);
int a = obj.nextInt();
int b = obj.nextInt();
int c = obj.nextInt();
System.out.println("The middle element is : ");
//Check if a is the middle
if(a>b&&a<c || a>c&&a<b){
System.out.println(a);
}
//Check if b is the middle element
else if(b>a&&b<c || b<a&&b>c){
System.out.println(b);
}
else{
System.out.println(c);
}
}
}
OUTPUT:-