Last active
November 13, 2018 16:41
-
-
Save piyushmaurya23/4a0f5b011037a79f56f6 to your computer and use it in GitHub Desktop.
4. Define a Recursive LISP function to compute factorial of a given number.
This file contains 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
(defun fact(n) | |
(if (= n 1) | |
1 | |
(* n (fact (- n 1))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if condition finishes after the line just after it,so 4th line ,ie the recursive call is automatically out of the if condition