lectures(monday, nolecture).
lectures(tuesday, vp).
lectures(tuesday, se).
lectures(tuesday, ddbms).
lectures(wednessday, ds).
lectures(wednessday, mpl).
lectures(thursday, vp).
lectures(thrusday, se).
lectures(friday, ds).
lectures(friday, mpl).
lectures(saturday, ai).
lectures(saturday, ddbms).
?- lectures(friday, X), write(X),nl.
the query print only first record as ds only, I want to print all record on particular day i.e Friday, the result should be ds and mpl.
update me!
Add fail. to the end of your query:
| ?- lectures(friday, X), write(X), nl, fail.
ds
mpl
no
| ?-
Also see this very similar question so try to use search a little bit more before asking a new question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With