A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

Discussion Forum

Que. Which one of the following prolog programs correctly implement “if G succeeds then execute goal P else execute goal q ?”
a. if-else (G, P, q) :- !, call(G), call(P). if-else (G, P, q) :- call(q).
b. if-else (G, P, q) :- call(G), !, call(P). if-else (G, P, q) :- call(q).
c. if-else (G, P, q) :- call(G), call(P), !. if-else (G, P, q) :- call(q).
d. All of the above
Answer:if-else (G, P, q) :- call(G), !, call(P). if-else (G, P, q) :- call(q).
Confused About the Answer? Ask for Details Here
Know Explanation? Add it Here

Similar Questions: