## Write a Java Program to check if the year is LEAP YEAR or NOT
public class CheckLeapYear { public static void main(String[] args) { int year = 2024; if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) { System.out.println("The year " + year + " is a leap year."); } else { System.out.println("The year " year + " is not a leap year."); } } } |
No comments:
Post a Comment