The Lisp Programming Language
Am I odd, or even?
Click below to go directly to a specific section:
Description | Source Code | Sample Run | Program Notes
This program checks whether the numbers that the user inputs at the prompt
are even or odd. This program displays Lisp's <if, else> clauses, and
how they are implimented.
(defun CHECK (x y)
(format t "Your two numbers are")
(cond((and (evenp x)(evenp y)) 'both_odd)
((and (oddp x)(oddp y)) 'both_even)
- This program was created by, Bruce Maxim, during lecture 13, while explaining Lisp commands
- Then tested and run using the XLISP-STAT Unix compiler Release 2. Copyright(c)1989-1999, by Luke Tierney.
Last modified: 2:40 AM on 11/16/1999 by Christopher Williams