Logo 
Search:

Artificial Intelligence Articles

Submit Article
Home » Articles » Artificial Intelligence » ProLogRSS Feeds

Prolog Program to find Maximum of X and Y using Cut Predicate

Posted By: Shaunak Patel     Category: Artificial Intelligence     Views: 9759

predicates
go.
max(integer,integer,integer).
clauses
go:-
readint(X), readint(Y),
max(X,Y,_).
max(X,Y,X):- X>Y ,!.
max(X,Y,Y).



Goal:  max(22,33,X)
X=33
1 Solution
  
Share: 



Shaunak Patel
Shaunak Patel author of Prolog Program to find Maximum of X and Y using Cut Predicate is from India.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!