Like in other programming languages, decision statements in Prolog are If-Then-Else statements. We check a condition. If it is true, then a task is performed and if it false, another set of tasks is performed.

The syntax to use a decision statement in Prolog is,

images

To implement decision making, create a new file, write the instructions given below and save it as dm.pl.

images
images

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *