num(X).write('even'), nl. :- mod(X, 2) is 0.
?- num(10)
prog.pl:1: warning: singleton variables [X] for num/1 prog.pl:2: fatal error: redefining control construct (',')/2 compilation failed
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!