Programs in lisp with output
Q. Define a LISP function to compute sum of squares.
SOFTWARE USED: LispWorks 6.1
THEORY:-
SUM OF SQUARE
Sum of square means by adding the squares of two numbers.
Example
Sum 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 sumsqr(x y)
( + ( * x x )( * y y )))
(sumsqr 2 3 )
13
RESULT:-
CONCLUSION:-
We defined a LISP function to compute sum of square and test it on various values.