LISP program to check whether a given string is a palindrome
kw.lisp
(write-line"———————————————————————————————————————————")(write-line"Program to check whether string is palindrome")(write-line"———————————————————————————————————————————")(princ"Enter the string ")(setqs(string(read)))(setqs1(strings))(setqs2(reverses1))(if(string-equals1s2)(formatt"~%~d is palindrome"s1))(if(string-not-equals1s2)(formatt"~%~d is not palindrome"s1))(terpri)(princ"———————————————————————————————————————————")
Output
kodingwindow@kw:~$ clisp kw.lisp
———————————————————————————————————————————
Program to check whether string is palindrome
———————————————————————————————————————————
Enter the string LOYAL
LOYAL is not palindrome
———————————————————————————————————————————
kodingwindow@kw:~$ clisp kw.lisp
———————————————————————————————————————————
Program to check whether string is palindrome
———————————————————————————————————————————
Enter the string LOL
LOL is palindrome
———————————————————————————————————————————
kodingwindow@kw:~$
Dear User, Thank you for visitng Kodingwindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.
Dear User, We are grateful for your interest in the Kodingwindow Android app. We intend to soon make it available on the Google Play Store. Currently, Android versions 10 and up require manual apk installations. Would you like to get the app?