Java Program for leap year

Java program to find whether the year is leapyear or not 


public class LeapYear
{
  public static void main(String args[ ])
  {
     int n=2004;
    if(n%4==0)
     {
     System.out.println("Year is leap year");
       }
    else 
    {
      System.out.println("Year is not leap year");
      }
    }
}


Output

Year is leap year

 

Comments