factorial(0,1).factorial(N,F):-N>0,N1 is N-1,factorial(N1,F1), F is N*F1.
Standard input is empty
Standard output is empty
ERROR: '$runtoplevel'/0: Undefined procedure: program/0 Exception: (3) program ? EOF: exit
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!