-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompareHundred.java
More file actions
46 lines (33 loc) · 942 Bytes
/
CompareHundred.java
File metadata and controls
46 lines (33 loc) · 942 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import java.util.Scanner;
public class CompareHundred{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print("Enter integer: ");
int integer = input.nextInt();
int square = integer * integer;
if (integer == 100){
System.out.printf("%d is equal to 100 %n", integer, 100);
}
if (integer != 100){
System.out.printf("%d is not equal to 100 %n", integer);
}
if (integer > 100){
System.out.printf("%d is greater than 100 %n", integer);
}
if (integer < 100){
System.out.printf("%d is less than 100 %n", integer);
}
if (square == 100){
System.out.printf("%d is equal to 100 %n", square);
}
if (square != 100){
System.out.printf("%d is not equal to 100 %n", square);
}
if (square > 100){
System.out.printf("%d is greater than 100 %n", square);
}
if (square < 100){
System.out.printf("%d is less than 100 %n", square);
}
}
}