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

(defun triangle (n)
  (cond 
    ( (floatp n) (print "Decimals number are not valid input, please enter an integer"))
    ( (stringp n) (print "Strings are not valid input, please enter an integer"))
  ) 
  
  (loop for i from 1 to n 
  
     do (loop for j from 1 to i
            do (write j)
        )
        
    (princ #\NewLine)
  
    )
)

(triangle 10)

Advertisements
Loading...

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