Monday, 21 October 2013

reverse

echo "Enter the string"
read str
reverse=`echo $str | rev`

if test $str = $reverse
then
echo "palindrome"
else
echo "Non-palindrome"
fi

No comments:

Post a Comment