Skip to content

Instantly share code, notes, and snippets.

@raushankrjha
Created September 13, 2019 19:30
Show Gist options
  • Save raushankrjha/a52ac4233996d0037cdc2bbc220aec50 to your computer and use it in GitHub Desktop.
Save raushankrjha/a52ac4233996d0037cdc2bbc220aec50 to your computer and use it in GitHub Desktop.
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