VILL- DEBANDI, AMTA, HOWRAH PIN-711410 Phone-9836357266
10. Write a Prolog program to implement max(X,Y,Max) so that Max is the greater of two numbers X and Y.
max(X,Y,R):-
X>=Y ->
R is X,
write(R)
;
R is Y,
write(R).
OUTPUT:
max(2,6,X).
6
X = 6
No comments:
Post a Comment