-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathswich1.java
More file actions
50 lines (44 loc) · 1.35 KB
/
swich1.java
File metadata and controls
50 lines (44 loc) · 1.35 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
50
package swichcase;
import java.util.Scanner;
public class swich1 {
// hafta kuni butun son berilgan
// shu songa mos bo'lgan hafta kuni nomi chop etilsin
// 5 -> juma
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int hafta = scanner.nextInt();
switch (hafta) {
case 1-> {
System.out.println("Dushanba");
break;
}
case 2 -> {
System.out.println("Seshanba");
break;
}
case 3 -> {
System.out.println("Chorshanba ");
break;
}
case 4->{
System.out.println("Payshanba");
break;
}
case 5->{
System.out.println("Juma");
break;
}
case 6->{
System.out.println("Shanba");
break;
}
case 7->{
System.out.println("Yakshanba");
break;
}
default -> {
System.out.println("Bunday hafta kuni mavjud emas");
}
}
}
}