Created
September 13, 2019 19:30
-
-
Save raushankrjha/a52ac4233996d0037cdc2bbc220aec50 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main() | |
{ | |
/*A leap year is exactly divisible by 4 except for century years (years ending with 00). | |
The century year is a leap year only if it is perfectly divisible by 400.*/ | |
var year=2019; | |
if(year%4==0) | |
{ | |
if(year%100==0) | |
{ | |
if(year%400==0) | |
{ | |
print(" $year, is a leap year"); | |
} | |
else | |
{ | |
print(" $year, is not a leap year"); | |
} | |
} | |
else | |
{ | |
print(" $year, is a leap year"); | |
} | |
} | |
else | |
{ | |
print(" $year, is not a leap year"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment