Last active
February 25, 2016 15:18
-
-
Save gaverdugo/fa151a380c01a1e64c8e to your computer and use it in GitHub Desktop.
Factorial con recursividad en Java.
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
public class Main { | |
private static long factorial(int num){ | |
if(num == 0) { | |
return 1; | |
} else { | |
return num * factorial(num - 1); | |
} | |
} | |
public static void main(String[] args) { | |
System.out.println(factorial(56)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment