Saturday, May 16, 2020

Artificial Intelligence Programs Using Prolog


9.Write a Prolog program to implement maxlist(List,Max) so that Max is the greatest number in the list of numbers List.
10. Write a Prolog program to implement sumlist(List,Sum) so that Sum is the sum of a given list of numbers List.
11. Write a Prolog program to implement GCD of two numbers.
12. Write a Prolog program to implement reverse(List,ReversedList) that reverses lists.
13. Write a Prolog program to implement palindrome(List).
14. Write a Prolog program to implement maxlist(List,Max) so that Max is the greatest number in the list of numbers List using cut predicate.
15. Write a Prolog program to implement two predicates evenlength(List) and oddlength(List) so that they are true if their argument is a list of even or odd length respectively.

No comments:

Post a Comment

15. Write a Prolog program to implement two predicates evenlength(List) and oddlength(List) so that they are true if their argument is a list of even or odd length respectively.

  Write a Prolog program to implement two predicates evenlength(List) and oddlength(List) so that they are true if their argument is a list ...