Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 01.05.2021
- import java.util.Scanner;
- public class Ex06 {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner in = new Scanner(System.in);
- int month;
- int days;
- System.out.print("Enter the month number: ");
- month = in.nextInt();
- switch (month) {
- case 1:
- case 3:
- case 5:
- case 7:
- case 8:
- case 10:
- case 12:
- days = 31;
- break;
- case 2:
- days = 28;
- break;
- case 4:
- case 6:
- case 9:
- default:
- days = 30;
- break;
- }
- System.out.println("Number of days = " + days);
- in.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement