Virajsinh

Palindrome_2_OS_Script

Oct 7th, 2017
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. echo "Enter No : "
  2. read no
  3.  
  4. m=$no
  5. rev=0
  6.  
  7. while [ $no -gt 0 ]
  8. do
  9. r=`expr $no % 10`
  10. rev=`expr $rev \* 10 + $r`
  11. no=`expr $no / 10`
  12. done
  13.  
  14. if [ $m = $rev ]
  15. then
  16. echo "Is Palindrome"
  17. else
  18. echo "Not Palindrome"
  19. fi
Add Comment
Please, Sign In to add comment