Advertisement
rafid_shad

leap year

Jan 27th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. package Factorial;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class lEAPYEAR {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner ss = new Scanner(System.in);
  9.  
  10.         int year = ss.nextInt();
  11.        
  12.         if (year % 4 == 0) {
  13.             if (year % 100 != 0) {
  14.                 System.out.println("Yes");
  15.             } else if (year % 400 != 0) {
  16.                 System.out.println("Yes");
  17.             } else {
  18.                 System.out.println("NO");
  19.             }
  20.         } else {
  21.             System.out.println("No");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement