forked from PrajaktaSathe/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntegers.java
More file actions
26 lines (26 loc) · 785 Bytes
/
Integers.java
File metadata and controls
26 lines (26 loc) · 785 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
class Main {
public static void main(String[] args) {
int one = 1;
int two = 2;
if (one == two) {
System.out.println("they are equal!");
} else {
if (one > two) {
System.out.println("one is greater than two");
} else {
System.out.println("two is greater than one");
}
}
int int1 = 3 * 3 + 1;
int int2 = 4 * 2;
if (int1 == int2) {
System.out.println("These integers are the same");
} else {
System.out.println("These integers aren't the same");
}
while (int2 < int1) {
System.out.println("Int2 is still less than int1");
int2++; //Adds one to int2
}
}
}