Java Program to Calculate Leap Year

Here is a simple java program to calculate Leap year….

class leap1
{
    public static void main(int year)
    {
        System.out.println(“Inputed YEAR :”+year);
        if (year%400==0)
        System.out.println(“This year is LEAP YEAR”);
        else if (year%100==0)
        System.out.println(“This year is not a LEAP YEAR”);
        else if (year%4==0)
        System.out.println(“This year is LEAP YEAR”);
    }
}

Add Comment