Prolog Write Predicate Filters Negative Numbers List Filter 34 1 0 7 0 8 10 0 10 R R 34 0 Q37035927

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


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.