Skip to content

Instantly share code, notes, and snippets.

@landjd19
Created October 11, 2018 03:44
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 landjd19/9d5f586169289da5809752ca208ddbff to your computer and use it in GitHub Desktop.
Save landjd19/9d5f586169289da5809752ca208ddbff to your computer and use it in GitHub Desktop.
Factorial
/**
* Write a description of class Factorial here.
*
* @author jake Landaiche
* @version 10/10/18
*/
import java.util.*;
public class Factorial
{
// instance variables - replace the example below with your own
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int input = sc.nextInt();
}
public int factorial(int n){
int total = 1;
for(int i = 1; i <= n; i++){
total *= i;
}
return total;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment