Code In Tech - The Ultimate World of Computer Technology

Tuesday 5 June 2012

Shell script to find Leap Year

SOURCE CODE:

echo "Enter the year :"
read year
d =`expr $year % 4'
if [ d -eq 0 ]
then
echo “$Given year is a leap year”
else
echo "$Given year is not a leap year”
fi



OUTPUT:

Enter the year :
2011
year is not leap year

No comments :

Post a Comment