Can someone tell me whats going wrong in this code!
testit :- read(Term1),
read(Term2),
(Term1 == Term2) ->
write(Term1);
write(Term2).
?- testit.
7.
8.
_L139.
true.
____
How I can print the value of Term2 in else part.???
(;)/2 has a different operator precedence than you seem to think. Use parentheses to get the intended nesting: