Wednesday, May 4, 2011

PROGRAM TO ADD 2 NUMBERS IN PROLOG


match(10).
manage:-nl,write('Do u wanna enter another value:'),nl,write('Enter 10 for yes:'),nl,write('Press any key for no:'),read(K),match(K).
add:- write(' *** welcome to program ***'),nl, write('Enter the value of variable1:'),read(X),write('\t\t\t Enter the value of variable2:'),read(Y),Z is X+Y,nl, write( Z), manage.

1 comment:

  1. would you please give me some tough programs in prolog along with corresponding c++ progams.plsssss

    ReplyDelete