Advertisement
tanjeel

Evens in Prolog

Apr 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.10 KB | None | 0 0
  1. evens([],[]).
  2. evens([H|T],[H|L]):-0 is H mod 2, evens(T,L).
  3. evens([H|T],L):-1 is H mod 2, evens(T,L).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement