aakash2310

season

Sep 23rd, 2022
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class season
  4. {
  5.      public static void main(String args[])
  6.      {
  7.             Scanner s = new Scanner(System.in);
  8.             System.out.println("Enter Month number : ");
  9.             int month = s.nextInt();
  10.        
  11.             if(month <= 4 && month >= 1)
  12.             {
  13.                 System.out.println("Season is Summer" );
  14.             }
  15.             else if( month <= 8 && month >= 5)
  16.             {
  17.                 System.out.println("Season is Monsoon" );
  18.             }
  19.             else if( month <= 12 && month >= 9)
  20.             {
  21.                 System.out.println("Season is Monsoon" );
  22.             }
  23.             else{
  24.                 System.out.println("Select month number between 1 to 12");
  25.             }
  26.            
  27.          }
  28.                
  29.  }
Advertisement
Add Comment
Please, Sign In to add comment