Aim: Write a lisp code for calculate whether the given number is even or odd.
Software Used: GNU common LISP
coding:
> (defun CHECK (X)
( format t " your Number is")
(cond((and (evenp x)) 'odd)
((and (oddp x)) 'even)
)
)
CHECK
> (defun CHECK (X)
( format t " your Number is")
(cond((and (evenp x)) 'odd)
((and (oddp x)) 'even)
)
)
CHECK
0 Comments
if you have any problem, please let me know