forked from examplehub/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIf.java
More file actions
24 lines (20 loc) · 686 Bytes
/
If.java
File metadata and controls
24 lines (20 loc) · 686 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
package com.examplehub.basics;
import java.util.Scanner;
public class If {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Please input first number:");
int firstNumber = scanner.nextInt();
System.out.println("Please input second number:");
int secondNumber = scanner.nextInt();
if (firstNumber == secondNumber) {
System.out.println(firstNumber + " == " + secondNumber);
}
if (firstNumber > secondNumber) {
System.out.println(firstNumber + " > " + secondNumber);
}
if (firstNumber < secondNumber) {
System.out.println(firstNumber + " < " + secondNumber);
}
}
}