Answers for "how to compute for leap year"

1

how can you know if a year is a leap year

leapYear = int(input("Input a Year "))

if leapYear %4 == 0:
    print("Its a leap year")
else:
    print ("Its a normal year")
Posted by: Guest on January-19-2022
1

leap year formula

$day = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
$year = 2021;

if (($year % 4 == 0 && $year % 100 != 0) || ($year % 400 == 0)) {
  $day = [ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
  echo "This is leap year - get 366 day";
  
} else {
   echo "This is NOT leap year - get ONLY 365 day";
}
Posted by: Guest on December-17-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language