java program to check if year is a leap year or not java tutorials for beginners

support simple snippets by donations -
google pay upi id - tanmaysakpal11@okicici
paypal - paypal.me/tanmaysakpal11
- in this java programming tutorial we will write a program to check if a year is leap year or not.

concept of leap year -
the rule states:
“every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100, but these centurial years are leap years if they are exactly divisible by 400.”

for example,
if year = 2400, it is leap year,(condition 1 satisfied)
but if year = 2200, is not a leap year, (cond. 2 not satisfied),
and if year = 2020, is a leap year, (cond. 2 satisfied).

to check whether a year is a leap year or not, you need to check the following 3 conditions:
if
1. any year that is divisible by 400 is definitely a leap year.
else if
2. if divisible by 4 and not divisible by 100 then a leap year.
else
not a leap year.

java leap year program code with output - https://simplesnippets.tech/java-program-to-check-if-year-is-a-leap-year-or-not/

download the free java programming android app from google playstore - https://play.google.com/store/apps/details?id=com.intelisenze.java.learnjavaprogramming

simple snippets official website -
https://simplesnippets.tech/
simple snippets on facebook-
https://www.facebook.com/simplesnippets/
simple snippets on instagram-
https://www.instagram.com/simplesnippets/
simple snippets google plus page-
https://plus.google.com/+simplesnippets
simple snippets email id-
simplesnippetsinfo@gmail.com

java program to check if year is a leap year or not java tutorials for beginners