fac( 0, 1) :-!. fac( N, Nfac) :- N > 0, M is N -1. fac( M, Mfac), Nfac is N*Nfac.
?- fac(5,X).
prog.pl:2-4: warning: singleton variables [Nfac,M] for fac/2
prog.pl:5-6: fatal error: redefining control construct (',')/2
compilation failed
Standard output is empty