-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathswitch4.java
More file actions
38 lines (33 loc) · 923 Bytes
/
switch4.java
File metadata and controls
38 lines (33 loc) · 923 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
30
31
32
33
34
35
36
37
38
package swichcase;
import java.util.Scanner;
public class switch4 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Oy Raqamini kiriting :");
int month = scanner.nextInt();
switch4Function(month);
}
public static void switch4Function(int month){
switch (month) {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
System.out.println("31 kunlik");
break;
case 4:
case 6:
case 9:
case 11:
System.out.println("30 kunlik");
break;
case 2:
System.out.println("28 yoki 29 kunlik");
default:
System.out.println("Oraliqqa tegishli emas");
}
}
}