In previous article we have seen how to find the population density of the country. In this we will discuss about how to append the list.
The following program appends a list B to another list A. The collective list is stored in list C. The base condition is “append ([], list B, list B)”. The program observes backtracking after the base condition is achieved.
PROGRAM:
append[x|y],z,[x,w]:-append(y,z,w),append([],x,x).
OUTPUT: