10. Write a Prolog program to implement memb(X, L): to check whether X is a member of L or not.
% Write a Prolog program to implement memb(X, L): to check whether
X is a member of L or not.
% below memb function is not predefined you can use any name as function
memb(X, [X|Tail]).
memb(X, [Head|Tail]):- memb(X, Tail).
% Output
No comments:
Post a Comment