forked from avinashbest/java-coding-ninjas
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRelationalOperator.java
More file actions
26 lines (21 loc) · 821 Bytes
/
Copy pathRelationalOperator.java
File metadata and controls
26 lines (21 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package gettingStarted;
import java.util.Scanner;
public class RelationalOperator {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int i = scan.nextInt();
int j = scan.nextInt();
boolean isEqual = (i == j);
boolean isNotEqual = (i != j);
boolean isGreater = (i > j);
boolean isGreaterEqual = (i >= j);
boolean isLess = (i < j);
boolean isLessEqual = (i <= j);
System.out.println("Is Equal " + isEqual);
System.out.println("Is Not Equal " + isNotEqual);
System.out.println("Is Greater " + isGreater);
System.out.println("Is Greater Equal " + isGreaterEqual);
System.out.println("Is Less " + isLess);
System.out.println("Is Less Equal " + isLessEqual);
}
}