Monday 31 October 2016

Write a Prolog program to calculate the sum of two numbers.

% 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
Video on Prolog Program to Calculate the Sum of Two Numbers.


4 comments:

  1. Pls give me domains & predicates

    ReplyDelete
    Replies
    1. Domains: X=integer and Y=integer
      Predicates: max(integer, integer)

      Delete
  2. sir
    you are not use any domain ,predicate and clauses keyword in program
    why

    ReplyDelete
  3. plese help
    Write prolog program to find the sum of 10 integer element using recursion.???

    ReplyDelete