A leap year (also known as an intercalary year or bissextile year) is a calendar year that contains an additional day (or, in the case of a lunisolar calendar, a month) added to keep the calendar year synchronized with the astronomical year or seasonal year.
import java.util.Scanner;
public class LeapYear {
public static void main(String[] args) {
int year;
Scanner sc = new Scanner(System.in);
System.out.println("Enter any year : ");
year = sc.nextInt();
if(year%4==0){
System.out.println("Year is leap year.");
}else{
System.out.println("Year is not leap year.");
}
}
}
Comments
Post a Comment