Program To Check Whether this Year is Leap Year Or Not in Java…

Program to find Leap Year Or Not How To check this year is Leap Year or Not With The Help Of Programming of 2019

Program to find Leap Year in JAVA Programming Language by using User Input

LeapYear.java

import java.util.Scanner;
class LeapYear
{ 
public static void main(String args[])
 {
int year;
Scanner sc=new Scanner(System.in);
     System.out.print("Enter the year:");
     year=sc.nextInt();
if(year%400==0)
{
   System.out.print(year+"is a Leap Year."); 
}
  else if(year%100=0)
{
  System.out.print(year+"is Not Leap Year"); 
}
 else if(year%4==0)
{
   System.out.print(year+"is a Leap Year."); 
}
  else
{
  System.out.print(year+"is Not Leap Year"); 
    } 
  }
}

/*OUTPUT
Enter the year :2000
2000 is! a Leap Year.
 
Enter the year :2004
2000 is! a Leap Year.
 
*/
0Shares

Leave a Reply