Java Program To Find Enter Year Is A Leap Year Or Not

import java.util.Scanner;
class scan
{
public static void main(String arg[])
 {
Scanner kb=new Scanner(System.in);
int year;
System.out.println("Enter year");
year=kb.nextInt();
if(year%4==0)
  {
   System.out.println("Year is a leap");
  }  
   else
  {
   System.out.println("Year is not leap");
  } 
}
}

OUTPUT 1

Enter year
2004
Year is a leap

OUTPUT 2

Enter year
2015
Year is not leap

Leave a Reply

Your email address will not be published. Required fields are marked *