-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConditions.java
55 lines (38 loc) · 1.31 KB
/
Conditions.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
43
44
45
46
47
48
49
50
51
52
53
54
55
import java.util.*;
public class Conditions {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in); /* Shift + Alt + A to comment multiple lines */
/* int age = sc.nextInt();
if (age > 18) {
System.out.println("Adult");
} else {
System.out.println("Not Adult");
} */
/* int x = sc.nextInt();
if (x % 2 == 0) {
System.out.println("even");
} else {
System.out.println("odd");
} */
// int a = sc.nextInt(); ( use Ctrl + / to comment multiple lines)
// int b = sc.nextInt();
// if (a == b) {
// System.out.println("a is equal to b");
// } else if (a < b) {
// System.out.println("a is lesser than b");
// } else {
// System.out.println("a is greater than b");
// }
int button = sc.nextInt();
switch (button) {
case 1 : System.out.println("Hello");
break;
case 2 : System.out.println("Namaste");
break;
case 3 : System.out.println("Bonjour");
break;
default : System.out.println("Invalid Button");
break;
}
}
}