Ai Prac File
Ai Prac File
7. Prolog program to implement multi (N1, N2, R) : where N1 and N2 denotes the
numbers to be multiplied and R represents the result.
8. Write a Prolog program to implement memb(X, L): to check whether X is a member
of L or not.
9. 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.
10. Write a Prolog program to implement reverse (L, R) where List L is original and List
R is reversed list.
11. Write a program in PROLOG to implement palindrome (L) which checks whether a
list L is a palindrome or not.
12. Write a Prolog program to implement sumlist(L, S) so that S is the sum of a given list
L.
17. Write a Prolog program to implement delete_nth (N, L, R) that removes the element
on Nth position from a list L to generate a list R.
18. Write a program in PROLOG to implement merge (L1, L2, L3) where L1 is first
ordered list and L2 is second ordered list and L3 represents the merged list.