-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitchn.java
More file actions
29 lines (27 loc) · 912 Bytes
/
switchn.java
File metadata and controls
29 lines (27 loc) · 912 Bytes
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
import java.util.*;
public class switchn {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
System.out.println("Enter number between 1 to 7");
int n = sc.nextInt();
switch(n){
case 1: System.out.println("Monday");
break;
case 2:System.out.println("tuesday");
break;
case 3:System.out.println("wednesday");
break;
case 4:System.out.println("thrusday");
break;
case 5:System.out.println("friday");
break;
case 6:System.out.println("saturday");
break;
case 7:System.out.println("sunday");
break;
default:System.out.println("not valid number");
break;
}
sc.close();
}
}