-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathconditional
44 lines (35 loc) · 1.05 KB
/
conditional
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
import java.util.Scanner;
public class IFELSE{
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
// Normal form of If else :-
// int age = sc.nextInt();
// if (age > 18){
// System.out.println("Adult");
// } else{
// System.out.println("Not Adult");
// }
//else if else:-
// int x = sc.nextInt();
// int y = sc.nextInt();
// if (x==y){
// System.out.println("Equal");
// } else{
// if (x>y){
// System.out.print("x is greater");
// } else{
// System.out.print("x is lesser ");
// }
// }
// else If :-
int x = sc.nextInt();
int y = sc.nextInt();
if (x==y){
System.out.println("Equal");
} else if (x>y){
System.out.print("x is greater");
} else{
System.out.print("x is lesser ");
}
}
}