Program:
echo "Enter number:"
read num
r=0
d=0
a=$num
while [ $num -gt 10 ]
do
d=`echo $num % 10 |bc`
r=`echo $r \* 10 + $d |bc`
num=`echo $num / 10 |bc`
done
d=`echo $num % 10 |bc`
r=`echo $r \* 10 + $d |bc`
if [ $a -eq $r ]
then
echo "given number is polindrome"
else
echo "given number is not polindrome"
fi
Input/OutPut
Enter number:
12321
given number is polindrome
Enter number:
34567
given number is not polindrome
hummmmmmm nice program
ReplyDeleteGOOOOOOOOOOOOD PROGRAM
ReplyDeletethank you......
ReplyDelete