% Write a prolog program to calculate the sum of two numbers.
% So, what is the function for above mentioned problem.
sum(X,Y):-
S is X+Y,
write(S).
% Output
![Prolog program to calculate the sum of two numbers Prolog program to calculate the sum of two numbers](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYG0vGqoZAHEovyACeyoiDRMzufjPEprOOSpvS4KFE2rfGpB3Fj65fhyphenhyphenhZDWJJ2opZx2-dg9duxZq2Bmf-p4VAtCEdrhr40u0hw3qr5PXmE5mVg6SXsauc3rDpdrFTFkUOPTma4VGrPJQ/s640/sum.png) |
Prolog program to calculate the sum of two numbers
|
Video on Prolog Program to Calculate the Sum of Two Numbers.
Pls give me domains & predicates
ReplyDeleteDomains: X=integer and Y=integer
DeletePredicates: max(integer, integer)
sir
ReplyDeleteyou are not use any domain ,predicate and clauses keyword in program
why
plese help
ReplyDeleteWrite prolog program to find the sum of 10 integer element using recursion.???