diff --git a/Maths/Factorial.java b/Maths/Factorial.java index 3feb4335..4f0262ae 100644 --- a/Maths/Factorial.java +++ b/Maths/Factorial.java @@ -1,9 +1,12 @@ package Maths; +import java.util.*; //for importing scanner -//change around 'n' for different factorial results public class Factorial { public static void main(String[] args) { - int n = 5; + int n = 1; +Scanner sc= new Scanner(System.in); +System.out.println("Enter Number"); +n=sc.nextInt(); System.out.println(n + "! = " + factorial(n)); }