public class Solution {
public static void main(String[] args) {
Scanner ip = new Scanner(System.in);
System.out.print("Enter A: ");
int a = ip.nextInt();
System.out.print("Enter B: ");
int b = ip.nextInt();
System.out.print("Enter C: ");
int c = ip.nextInt();
int great = a >= b ? (a >= c ? a : c) : (b >= c ? b : c);
System.out.println("Greatest among three numbers is: " + great);
ip.close();
}
}OUTPUT:
Enter A:
Enter B:
Enter C:
Greatest among three numbers is: