Question: Write a Prolog predicate expt(M, N, E), where M, N and E are integers, N 0, and E = M N . Test your predicate

Write a Prolog predicate expt(M, N, E), where M, N and E are integers, N 0, and E = M N .

Test your predicate on the following.

expt(10, 0, E) E = 1

expt(3, 4, E) E = 81

expt(-10, 6, E) E = 1000000

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!