LEAP YEAR

SOURCE CODE:
echo “Enter the year”
read year
chk=`expr $year % 4`
if [ $chk –eq 0 ]
then
echo “ $Given year is a leap year ”
else
echo “ $Given year is not a leap year ”
fi

OUTPUT:
[examuser35@localhost Jebastin]$ sh leap.sh
Enter the year
1995
year is not leap year

[examuser35@localhost Jebastin]$ sh leap.sh
Enter the year
1998
Given year is a leap year
Previous
Next Post »

If you still didn't find what you're looking for, you can search this website below: