Programs in lisp with output
SOFTWARE
USED: LispWorks 6.1
THEORY:-
DIFFERENCE OF SQUARE
Difference of square means
by subtracting the squares of two numbers.
Example
Difference of square of x,y= (
x * x ) - ( y * y )
Now in prefix expression
it should be written as
( - ( * x x ) ( * y y ) )
SOURCE
CODE ( IF INCLUDED )
(defun diffsqr(x y)
( - ( * x x ) (
* y y ) )
( diffsqr 4 3 )
7
RESULT:-
CONCLUSION:-
We defined a LISP function to compute difference
of square and test it on various values.