1

I am trying to execute the following code where I want to check all conditions:-

w(X):-
    (     X=1 ->  
        write('Yes'),nl;
          X=1 ->  
        write('Yes'),nl;
          X=2 ->  
        write('No')).

I want it to write with X=1.

Yes
Yes

P.S. this is if-else, but I don't want if-else.

How can I achieve this, the code just returns the first true it finds?

Reema Q Khan
  • 878
  • 1
  • 7
  • 20

0 Answers0