Monday, 27 May 2013

Shell Script to find even and odd numbers

echo -n "Enter Number:- "
read num
n=$(($num%2))
if test $n -eq 0
then
echo "$num is Even Number"
else
echo "$num is Odd Number"
fi

No comments:

Post a Comment