-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumbersComparison.java
More file actions
23 lines (22 loc) · 897 Bytes
/
NumbersComparison.java
File metadata and controls
23 lines (22 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.util.Scanner;
public class NumbersComparison {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("-----------------------------");
System.out.println("| ENTER THREE NUMBERS |");
System.out.println("-----------------------------");
System.out.print("Enter any number: ");
double a = input.nextDouble();
System.out.print("Enter any number: ");
double b = input.nextDouble();
System.out.print("Enter any number: ");
double c = input.nextDouble();
if ((a == b) && (a == c)) {
System.out.println("All NUMBERS ARE EQUAL");
} else if ((a == b) || (a == c) || (b == c)) {
System.out.println("TWO NUMBERS ARE EQUAL");
} else {
System.out.println("ALL NUMBERS ARE DIFFERENT");
}
}
}