HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

Java Program to check if year is a LEAP year or Not | Java Tutorials for Beginners

31,413 views November 10, 2018 7:42

Watch on YouTube
ChannelSimple Snippets

Description from the creator

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 - simplesnippets.tech/java-program-to-check-if-ye…

Download the FREE Java Programming Android App from Google Playstore - play.google.com/store/apps/details?id=com.intel…

Simple Snippets Official Website -
simplesnippets.tech/
Simple Snippets on Facebook-
facebook.com/simplesnippets/
Simple Snippets on Instagram-
instagram.com/simplesnippets/
Simple Snippets Google Plus Page-
plus.google.com/+SimpleSnippets
Simple Snippets email ID-
[email protected]

About this tutorial

Simple Snippets published this 7:42 video tutorial on November 10, 2018. It has been watched 31,413 times on YouTube.

Category
Education
Duration
7:42
Published
November 10, 2018
Views
31,413
Likes
523

Tags

Share

This tutorial in other languages