write a shell script to identify the given string is
palindrome or not?
Answer Posted / lekhrajdeshmukh
n=$1
a=0
b=0
while [ $n -gt 0 ]
do
b=$(( $n % 10 ))
a=$(( ($a * 10) + $b ))
n=$(( $n /10 ))
done
if [ $a -eq $1 ]
then
echo "$1 number is palindrome number"
else
echo "$1 is not an palindrome number"
fi
| Is This Answer Correct ? | 56 Yes | 53 No |
Post New Answer View All Answers
What is the conditional statement in shell scripting?
What is the best shell scripting language?
Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.
What is meant by $1 in shell script?
What is the default shell of solaris?
What is path in shell script?
What is the use of break command?
how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?
Explain about echo command?
Explain about login shell?
What are the advantages of shell script?
Is shell scripting useful?
What is $1 in shell scripting?
What are filters explain sort with all the options available?
What are different types of shell?