Write a Prolog program to implement conc (L1, L2, L3) where L2 is the list to be appended with L1 to get the resulted list L3.

11.Write a Prolog program to implement conc (L1, L2, L3) where L2 is the list to be appended with L1 to get the resulted list L3.

% Write a Prolog program to implement conc (L1, L2, L3) where L2 is the 
  list to be appended with L1 to get the resulted list L3.

%  below conc function is not predefined you can use any name as function

conc([],L1,L1).
conc([X|T],L2,[X|T1]):- conc(T,L2,T1).


% Output


No comments:

Post a Comment

Featured post

Amazon Interview Process

On July 5, 1994, Jeff Bezos started the world's most "customer-centric" firm out of his garage in Bellevue, Washington. The A...