Aim: Write a lisp code to find value of exponential (a n). (Using function).
Software Used: Gnu Common LISP
coding:
>(defun power (x y)
(if (= y 0) 1
(* x(power c(- y 1)))))
POWER
>(power 2 4)
16
OUTPUT :
>(defun power (x y)
(if (= y 0) 1
(* x(power c(- y 1)))))
POWER
>(power 2 4)
16
OUTPUT :
0 Comments
if you have any problem, please let me know