-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcondition.java
42 lines (38 loc) · 1.24 KB
/
condition.java
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
import java.util.*;
public class condition {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Check Adult Or Not Adult-----------------
/*
int age = sc.nextInt();
if (age > 18) {
System.out.println("Adult");
}
else {
System.out.println("Not Adult");
}*/
//-------------------------------------------
// Check Even or Odd Number -----------------
/*
int x = sc.nextInt();
if (x % 2 == 0) {
System.out.println("Even Number");
}
else {
System.out.println("Odd Number");
}*/
//---------------------------------------------
// Check Two Number Equal Or Not Equal Or Which Number is greater or lesser--
int a = sc.nextInt();
int b = sc.nextInt();
if (a == b){
System.out.println("Equal");
} else if (a > b) {
System.out.println("a is greater.");
}
else {
System.out.println("a is a lesser");
}
//----------------------------------------------------------------------------
}
}