Write a script to check whether a given number is palindrome or not

echo "enter the number"

read num
rev=$( echo $num | rev)
if [ $num -eq $rev ]
then
echo "number is palindrome"
else
echo "number is not palindrome"
fi

output:-






Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post