answersLogoWhite

0


Best Answer

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

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a shell program in unix to find palindrome of the number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a Shell program to find the smallest number from a set of numbers?

k


Write a Shell program to find the sum of cube of individual digits of a number?

no thanks


Write a program in shell script to display odd number from 0 to 100?

seq 1 2 99


Shell program for gcd of three given numbers?

write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? check bellow link http://bashscript.blogspot.com/2009/08/gcd-of-more-than-two-numbers.html


Write a shell program to check and display 10 leap years?

dono


Shell program to find the smallest digit of a given number?

syntax error


Write a shell program to delete all the files in the current directory?

in winxp del *.* /Q /S


Write a shell program called whos to display a sorted list of the logged in usersJust display the user names and no other information?

The 'users' command should do that; you don't need to write a shell script to get that information in that format.


Write a Shell program to find the area and circumference of a circle?

echo "Enter the Number" read n r=`expr $n % 2` if [ $r -eq 0 ] then echo "$n is Even number" else echo "$n is Odd number" fi


Write a shell program using if-the-else to test whether a variable name is a directory or a file?

see : Write_a_shell_program_using_the_if-the-else_to_test_whether_a_variable_name_is_a_directory_or_a_file


Write a shell program to translate the6 etcpasswd file into uppercase?

tr [:lower:] [:upper:] < /etc/passwd > somefile


Write a shell script that counts a number of unique word contained in the alphabetical order line by line?

use python, shell is stupid