-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExp1.java
32 lines (32 loc) · 832 Bytes
/
Exp1.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
class Grade {
public static void main(String[] args) {
int x = 45;
int key = x / 10;
switch (key) {
case 0, 1, 2, 3: {
System.out.println("Fail");
break;
}
case 4: {
System.out.println("Pass");
break;
}
case 5: {
System.out.println("2nd class");
break;
}
case 6: {
System.out.println("1st Class");
break;
}
case 7, 8, 9: {
System.out.println("Distinction");
break;
}
default: {
System.out.println("Invalid");
break;
}
}
}
}