LISP program to find the min and max of two numbers
kw.lisp
(write-line"———————————————————————————————————————————")(write-line"Program to find the min/max of two numbers")(write-line"———————————————————————————————————————————")(princ"Enter the 1st number ")(setqa(read))(princ"Enter the 2nd number ")(setqb(read))(formatt"~%Minimum of ~d OR ~d = ~d"ab(minab))(formatt"~%Maximum of ~d OR ~d = ~d"ab(maxab))(terpri)(formatt"———————————————————————————————————————————")
Output
kodingwindow@kw:~$ clisp kw.lisp
———————————————————————————————————————————
Program to find the min/max of two numbers
———————————————————————————————————————————
Enter the 1st number -50
Enter the 2nd number 10
Minimum of -50 OR 10 = -50
Maximum of -50 OR 10 = 10
———————————————————————————————————————————
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.