Visitor No.

Sunday 13 December 2015

LISP function to compute difference of squares.

3 - Define a LISP function to compute difference of squares.

    Implementation Code in LISP -

      (defun difsqr(a b)
      ( if(> a b)
      (- (* a a) (* b b))
      (- (* b b) (* a a))))

    OUTPUT-

      (difsqr 3 4)
        7

No comments:

Post a Comment