Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a shell script to identify the given string is
palindrome or not?

Answer Posted / hemanth kadham

echo "PALINDROME NUMBER"
echo "ENTER THE NUMBER :"
read n
n1=$n
rev=0
while [ $n1 -ne 0 ]
do
rem=`expr $n1 % 10`
n1=`expr $n1 / 10`
rev=`expr $rem + $n1 \* 10`
done
if [ $n -eq $rev ]
then
echo $n is a Palindrome Number
else
echo $n is not a Palindrome Number
fi

PALINDROME NUMBER
ENTER THE NUMBER :
121
121 is a Palindrome Number
$sh palno.sh
PALINDROME NUMBER
ENTER THE NUMBER :
123
123 is not a Palindrome Number

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the various stages of a linux process it passes through?

1085


What does path stand for?

991


What is the command to find out users on the system?

917


Explain about login shell?

1054


Explain how you Automate your application using Shell scripting.

2245


Please give me example of " at command , contrab command " how to use

2720


write a shell script to check the failed jobs?

4351


How important is shell scripting?

983


What is the best shell scripting language?

951


What is shift command in shell script?

963


How do you debug a script?

999


What is echo in shell?

1045


How to print the first array element?

979


What is the syntax of "nested if statement" in shell scripting?

1038


Why should we use shell scripts?

992