Thursday, May 1, 2008

Write a shell script to find the given number is odd or even.

echo “Enter number”

read n

expr ‘$r=$n%2’

if [$r -eq 0] then

echo “even”

else

echo “odd”

fi

No comments: