factorial(0,1):- !.factorial(X, Y):- Z is X*Y, factorial(X-1, Z), write(Y).
factorial(5,X).
GNU Prolog 1.3.1 By Daniel Diaz Copyright (C) 1999-2009 Daniel Diaz uncaught exception: error(instantiation_error,(is)/2)
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!