fork download
  1. factorial(0,1).
  2.  
  3. factorial(N,F) :-
  4. N>0,
  5. N1 is N-1,
  6. factorial(N1,F1),
  7. F is N * F1.
Success #stdin #stdout 0.01s 68352KB
stdin
?-fac(5,X)
stdout
GNU Prolog 1.3.1
By Daniel Diaz
Copyright (C) 1999-2009 Daniel Diaz
uncaught exception: error(syntax_error('user_input:1 (char:3) . or operator expected after expression'),read_term/3)