Google Search

Saturday, October 24, 2015

PROLOG Code for Factorial

fact(0,1).
fact(N,F):-N>0,N1 is N-1,fact(N1,F1),F is N*F1.

No comments:

Post a Comment