echo "Enter a number"
read num
t=$num
reverse=0
while [[ $num -gt 0 ]]
do
remainder=$(( $num % 10 ))
reverse=$(( $reverse * 10 + $remainder ))
num=$(( $num / 10 ))
done
echo "Reversed number is : $reverse"
if [[ $reverse = $t ]]
then
echo "rev and num are same"
else
echo "rev and num are not same"
fi
To embed this project on your website, copy the following code and paste it into your website's HTML: