Header Ads

LISP Program to find maximum of two numbers

Lisp

Write a LISP Program to find maximum of two numbers  ?.

Program/Code:

(defun max1()
(format t "Enter 1st number :")
(setf a(read))
(format t "Enter 2nd number :")
(setf b(read))
(if(> a b)
(setf m a)
(setf m b)
)
(format t "Maximum =~d" m)
)



Output:
Enter 1st number:3
Enter 2nd number:12
Maximum =12

No comments:

Your comment will be visible after review.