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