+ 1
Why am I getting the wrong output?
code:- program :- write((3+4)). :- program. output:- 3+4
5 Respostas
0
No the output is right.
Try using variable
0
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.
0
Sorry what u want for output?
0
Value of X.
In swi-prolog I am getting __18..something.
while the value of X is 12
0
start:- sum,nl.
sum:- write('X= '),read(X),
write('Y= '),read(Y),
S is X+Y,
write('Sum is '),write(S).
Is that help?