Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute LISP Online

;Plaindrom number check
(defun IsPalindrom (N)
(setq m 0)
(setq k 1)
(loop while (/= m N) do
(setq k1 k)
(setq q 1)
(setq invertk 0)
(loop while (/= k1 0) do
(setq modk (mod k1 10))
(setq invertk (+ (*
invertk 10) modk))
(setq k1 (floor (/ k1
10)))
)
(if (eq k invertk)
(progn
(print k)
(setq m (1+ m))
)
)
(setq k (1+ k))
)
)

(IsPalindrom 20)

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.