PHP Practical Slip 12 Q.B

Write a PHP Script to check whether a year is a leap or not.

<?php
// Year to check
$year = 2024;

// Check leap year condition
if (($year % 4 == 0 && $year % 100 != 0) || ($year % 400 == 0)) {
    echo $year . " is a Leap Year.";
} else {
    echo $year . " is not a Leap Year.";
}
?>
Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top