Example: /* Loads the file ex1.pro: */ ?- [ex1]. yes ?- double. Please input a number? 3. Double is 6
You write this code in a text file called ex1.pro. nl - means new line /* Those are comments in Prolog. Always write something about your predicate. */ double:- write('Please input a number? '), read(X),nl, write('Double is '), Y is 2 * X, write(Y),nl.