Write a shell script to find whether a given year (4 digits) is leap year or not.

echo -e “Enter the year::\c”

read y

if [ expr $y % 4 -eq 0 ]

then

echo $y is Leap Year

else

echo $y is not Leap Year

fi

 

OUTPUT::

Enter the year::2005

2005 is not Leap Year

 

 

Share

Leave a Reply

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

Time limit is exhausted. Please reload CAPTCHA.