Write a program to find whether the given year is leap year or not?

clear
echo "enter the year"
read year

if [ `expr $year % 4` -eq 0 ]
then
echo "$year is leap year"
else
echo "$year is not leap year"
fi


OutPut
enter the year
2010

2010 is not leap year
enter the year
2011

2011 is not leap year

No comments:

Post a Comment