VILL- DEBANDI, AMTA, HOWRAH PIN-711410 Phone-9836357266
8. Write a Prolog program to implement append for two lists.
app([],L,L).
app([X|M],N,[X|Q]):-
app(M,N,Q).
OUTPUT:
app([1,2],[3,4],X).
X = [1, 2, 3, 4]
app([1,2],[],X).
X = [1, 2]
No comments:
Post a Comment