Repository navigation
Largest Among Three Numbers
import java.util.Scanner;
public class LargestNumber {
public static void main(String[] args) {
int a, b, c;
Scanner sc = new Scanner(System.in);
System.out.println("Enter Three Numbers");
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextInt();
if (a > b && a > c) {
System.out.println("The largest number is: " + a);
} else if (b > a && b > c) {
System.out.println("The largest number is: " + b);
} else if (c > a && c > b) {
System.out.println("The largest number is: " + c);
} else if (a == b && b == c) {
System.out.println("All numbers are equal");
} else {
System.out.println("Invalid Input");
}
}
}