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 / onkar

# Check wheather given number is Palindrome or Not ?
# for ex- 121 -palindrome ,123 -Not palindrome

echo "Enter Number\n"
read no
n1=$no
rev=0
while [ $n1 -ne "0" ]
do
rem=`expr $n1 % "10"`
n1=`expr $n1 / "10"`
rev=`expr $rem + $rev \* "10"`
done
if [ $no -eq $rev]
then
echo Palindrome
else
echo Not Palindrome
fi

Is This Answer Correct ?    14 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When should shell programming/scripting not be used?

1164


I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?

2183


How can I send a mail with a compressed file as an attachment?

1047


Is powershell a language?

1057


What are "c" and "b" permission fields of a file?

1033


What is path in shell script?

1102


What are the types of script?

1186


what is info area how many types?

2779


What does $@ mean bash?

1183


Is shell scripting difficult?

963


What is an inode block?

1071


What is subshell?

962


i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..

2140


What language is used in terminal?

995


Is shell a scripting language?

1023