Created
October 11, 2018 03:44
-
-
Save landjd19/9d5f586169289da5809752ca208ddbff to your computer and use it in GitHub Desktop.
Factorial
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
/** | |
* 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