Skip to content

Instantly share code, notes, and snippets.

@feehe21
Created October 11, 2018 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save feehe21/14bbb66ebc59dd03465b6ad1634e4e33 to your computer and use it in GitHub Desktop.
Save feehe21/14bbb66ebc59dd03465b6ad1634e4e33 to your computer and use it in GitHub Desktop.
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