Computer Science · Prolog
Given the following clauses in the Prolog database: like_to_read('John', 'Mathematics'). like_to_read('John', 'Comp.Sc.'). like_to_read('Bill', 'Physics'). like_to_read('Kate', 'Chemistry'). like_to_read('Bill', X) :- like_to_read('John', X). What will be the values bound to Result for the query: ?- like_to_read('Bill', Result).
- 1Result = Mathematics
- 2Result = Physics, Mathematics, Comp.Sc.✓
- 3Result = Physics
- 4Result = Mathematics, Comp.Sc., Physics
Correct answer
Result = Physics, Mathematics, Comp.Sc.
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Prolog?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · Prolog