i done my prolog coding and no error when run it. but still cannot get the output i want. so i want to ask where is the problem. my coding is like bellow
even_member(X, [X|_]).
even_member(X, [_|Tail]) :-
0 is X mod 2,
write(X), nl,
even_member(X, Tail).
the output i need it is when key in even_member(2,[1,2,3,4,5,6]). will get output like bellow
X=2
X=4
X=6
yes
Can anyone help me tell me what's the problem for my coding. Thank you.