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

lisp

(print "Enter a number")
(terpri)
(setf x (read))
(format t "Enter ~S numbers " x)
(terpri)
(setf flag 0)
(setf my-array (make-array x))
(dotimes (y x)
(setf (aref my-array y) (read))
)
(write-line "Enter a number to be searched")
(setf q (read))
(dotimes (y x)
(if (= (aref my-array y) q)
(progn (write-line "Number found")
(setf flag 1))
)
)
 
(if ( = flag 0)
(format t "The number ~S doesnot exist" q)
)

Advertisements
Loading...

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