Created
May 29, 2019 17:31
-
-
Save Macorreag/87f4c5ee6652f0c27c8babb2b8de2ff7 to your computer and use it in GitHub Desktop.
factorial en prolog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
factorial(0,1). | |
factorial(N,M):-N>0, N1 is N-1,factorial(N1,M1),M is N*M1. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment