# SS9
# Script to determine whether a given year is leap or not
# Usage: SS9 [year]
if  [$# -eq 0 ]
then
  echo Enter year
  read year
else
  year=$1
fi
if [‘expr $year %100‘ -eq 0 ]
then
  if [ ‘expr $year %400‘ -eq 0 ]
  then
        echo $year is a leap year
  else
        echo $year is not a leap year
  fi
else
  if [‘expr $year %4‘ -eq 0 ]
  then
        echo $year is a leap year
  else
        echo $year is not a leap year
  fi
fi
No comments:
Post a Comment