"prolog" Write a procedure exp(Base,Exponent,Result) code example
Example: write a procedure exp(Base,Exponent,Result) prolog
exp(_, 0, 1).
exp(0, _, 0).
exp(Base, Exponent, Result):-
Base #>= 0,
Exponent #>= 0,
E1 #= Exponent-1,
exp(Base, E1, R1),
Result #= Base*R1.