Pages

Tuesday, March 19, 2013

Write a script to check the given number is even or odd number?


$vi even_odd.sh
echo “enter a number: “
read n
if [ `expr $n % 2` = 0 ]
then
echo “entered number : even number”
else
echo “entered number : odd number “
fi
:wq

No comments:

Post a Comment