-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonths_Switch.java
More file actions
49 lines (48 loc) · 1.36 KB
/
Copy pathMonths_Switch.java
File metadata and controls
49 lines (48 loc) · 1.36 KB
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
import java.util.*;
public class Months_Switch {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
switch (n) {
case 1:
System.out.println("jan");
break;
case 2:
System.out.println("Feb");
break;
case 3:
System.out.println("March");
break;
case 4:
System.out.println("April");
break;
case 5:
System.out.println("May");
break;
case 6:
System.out.println("June");
break;
case 7:
System.out.println("July");
break;
case 8:
System.out.println("Aug");
break;
case 9:
System.out.println("Sep");
break;
case 10:
System.out.println("Oct");
break;
case 11:
System.out.println("Nov");
break;
case 12:
System.out.println("Dec");
break;
default:
System.out.println("Invalid choice");
}
sc.close();
}
}