Prolog program to add an element in a last position in given list.
domains list=symbol* predicates add(symbol,list,list) clauses add(X,[],[X]). add(X,[Y|Tail],[Y|Tail1]):- add(X,Tail,Tail1). OUT PUT ======= Goal: add(e,[a,b,c,d],NewList) NewList=["a","b","c","d","e"] 1 Solution