-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRelationalOperator.java
More file actions
23 lines (23 loc) · 896 Bytes
/
Copy pathRelationalOperator.java
File metadata and controls
23 lines (23 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//Relational Operator
import java.util.Scanner;
public class RelationalOperator {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("enter two number");
int first = in.nextInt();
int second = in.nextInt();
boolean r = first > second;
System.out.println(first + " > " + second + ":" + r);
r = first < second;
System.out.println(first + " < " + second + ":" + r);
r = first >= second;
System.out.println(first + " >= " + second + ":" + r);
r = first <= second;
System.out.println(first + " <= " + second + ":" + r);
r = first == second;
System.out.println(first + " == " + second + ":" + r);
r = first != second;
System.out.println(first + " != " + second + ":" + r);
in.close();
}
}