Created
October 11, 2018 22:18
-
-
Save feehe21/14bbb66ebc59dd03465b6ad1634e4e33 to your computer and use it in GitHub Desktop.
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 factoral{ | |
public factoral(){ | |
System.out.println(factorial(6)); | |
} | |
public int factorial(int n){ | |
int product = 1; | |
for(int i = 1; i <= n; i++){ | |
product *= i; | |
} | |
return product; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment