Why am I getting the wrong output?
code:- program :- write((3+4)). :- program. output:- 3+4
No the output is right. Try using variable
I have tried using but there is an error see it:- X is 3*4. program :- write(X). :- program. and:- X = 3*4. program :- write(X). :- program. and:- X is 3*4. X = 12. program :- write(X). :- program.
Sorry what u want for output?
Value of X. In swi-prolog I am getting __18..something. while the value of X is 12
start:- sum,nl. sum:- write('X= '),read(X), write('Y= '),read(Y), S is X+Y, write('Sum is '),write(S). Is that help?