samedi 4 avril 2020

LISP Programming Concerns

This is a simple question, but does anyone know how to find the largest of four numbers in a LISP program? I need to use an if statement for it but anyone else I've asked only uses conditional statements.

(defun largest (a b c d) 
    (write
        (if 
            (> (> (> a b) c) d)))

(largest 5 12 16 20)

If anyone could help me out it'd be great.

Aucun commentaire:

Enregistrer un commentaire