Program:
if test $# -lt 1
then
echo year is not given
echo default year is taken
year=`date | cut -c 25-29`
y=`expr $year % 4`
else
yar=$1
y=`expr $yar % 4`
fi
if test $y -eq 0
then
echo "Given year is leap year"
else
echo "Given year is not a leap year"
fi
Input/OutPut
year is not given
default year is taken
Given year is not a leap year
No comments:
Post a Comment