In Prolog,
Write a predicate that filters the negative numbers in alist.
?- filter ([34, -1, 0, 7, 0, 8, -10, 0,10], R).
R=[34,0,7,0,8,0,10]
Solution
In Prolog,
Write a predicate that filters the negative numbers in alist.
?- filter ([34, -1, 0, 7, 0, 8, -10, 0,10], R).
R=[34,0,7,0,8,0,10]
Solution