Skip to content

Commit be0dffb

Browse files
switch
1 parent e84ada1 commit be0dffb

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

simple switch algoritham

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import java.util.Scanner;
2+
3+
public class test1 {
4+
public static void main(String[] args)
5+
{
6+
while(true)
7+
{
8+
int x;
9+
10+
System.out.println("enter the number between 1 to 4");
11+
Scanner sc=new Scanner(System.in);
12+
x=sc.nextInt();
13+
14+
15+
switch (x)
16+
{
17+
case 1:
18+
System.out.println("sunday");
19+
break;
20+
case 2:
21+
System.out.println("monday");
22+
break;
23+
case 3:
24+
System.out.println("tuseday");
25+
break;
26+
case 4:
27+
System.out.println("wensday");
28+
break;
29+
default:
30+
System.exit(0);
31+
32+
33+
}
34+
}
35+
36+
37+
}
38+
}

0 commit comments

Comments
 (0)