Shell Script Program To Check Leap or Non-Leap Year

echo "Enter Year:"

read a

year=$a

y=$(( $a % 4 ))

if [ $y -eq 0]

then
	z=$(( $a % 100 ))

else
	echo "$year is not a leap year!"

fi


if [ $z -eq 0 ]

then
    echo "$year is a leap year!"
else
    echo "$year is not a leap year!"
fi

Leave a comment