Answers

2015-08-12T21:26:08+05:30
Class LeapYear
{
static void main(int year)
{
if((year % 4 == 0) && (year % 100 != 0))
{
System.out.print("year is leap year");
}
else if((year % 4 == 0) && (year % 100 == 0) && (year % 400 == 0))
{
System.out.print("year is the leap year");
}
else
{
system.out.print("year is not leap year");
}
}
}
1 5 1
2015-08-13T00:53:02+05:30
Import java.util.*;
class leap
{
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);
        System.out.println("Enter the number to check");
        int y = sc.nextInt();
        int c=y%4;
        if(c==0)
        System.out.println("This year is a leap year");
        else
        System.out.println("This is not a leap year");
    }
}
0