Created
December 2, 2025 11:04
-
-
Save emanoelbarreiros/abfd09ace8e0e43b4ff1fc40e701bc44 to your computer and use it in GitHub Desktop.
Fatorial recursivo
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
| public class Fatorial { | |
| public static int fatorial(int n) { | |
| if (n == 0 || n == 1) { | |
| return 1; | |
| } else { | |
| return n * fatorial(n - 1); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment