Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /**
- * Created by Jo on 2/21/2017.
- */
- public class Factorial {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- int number = Integer.parseInt(console.nextLine());
- int factoriel = 1;
- for (int i = 1; i <= number; i++) {
- factoriel *= i;
- }
- System.out.println(factoriel);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement