I have made a program for finding the greatest of the given three numbers. It works for single digit but it is not working for three digit numbers. Why not?
package practice;
import java.util.Scanner;
public class AllPractice {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
if(a > b) {
if (a > c) {
System.out.println("maximum of the given numbers "+a);
}else {
if (b > a) {
if (b > c) {
System.out.println("maximum of the given numbers "+b);
}
}else {
System.out.println("maximum of the given numbers "+c);
}
}
}
}
}