import java.util.*;
import java.lang.*;
import java.io.*;

// The main method must be in a class named "Main".
class Main {
    public static void main(String[] args) {
      
      Scanner sc = new Scanner (System.in);
      
      
      
        System.out.println("Check leap year or not");
  
         System.out.println("Write year in [yyyy] format" );
  
         int year = sc.nextInt();
  
         
         //  2024%4 =0 hoga  %modulo direct reminder btata h ab agr 4 se koi bhi divide hoga toh w leap year hoga  
          if(year%4==0)
         { System.out.println(year+" is a leap year");
         }
         
          else 
        {  System.out.println(year+" is not a leap year");
         }
  
   }
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: