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


File Name : ex21.sh


clear
echo "Enter No : \c"
read no

m=$no
rev=0

while [ $no -gt 0 ]
do
            r=`expr $no % 10`
            rev=`expr $rev \* 10 + $r`
            no=`expr $no / 10`
done

if [ $m = $rev ]
then
            echo " [ $m] is Palindrome"
else
            echo " [ $m ] is not Palindrome"
fi


4 comments:

Unknown said...

not working....

Manohar Golla said...

this wont work

Unknown said...

good

Venkat Shanthi said...

Very informative article.Thank you author for posting this kind of article .


http://www.wikitechy.com/view-article/c-program-to-check-armstrong-number-with-example-and-explanation



Both are really good,
Cheers,
Venkat

Follow by Email

Total Pageviews

© BipinRupadiya.com. Powered by Blogger.