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 ")
(setq a(read))
(princ "Enter the 2nd number ")
(setq b(read))
(format t "~%Minimum of ~d OR ~d = ~d"a b (min a b))
(format t "~%Maximum of ~d OR ~d = ~d"a b (max a b))
(terpri)(format t "———————————————————————————————————————————")
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:~$ 
Advertisement