We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3b24502 commit 1c062e2Copy full SHA for 1c062e2
1 file changed
Maths/Factorial.java
@@ -1,9 +1,12 @@
1
package Maths;
2
+import java.util.*; //for importing scanner
3
-//change around 'n' for different factorial results
4
public class Factorial {
5
public static void main(String[] args) {
6
- int n = 5;
+ int n = 1;
7
+Scanner sc= new Scanner(System.in);
8
+System.out.println("Enter Number");
9
+n=sc.nextInt();
10
System.out.println(n + "! = " + factorial(n));
11
}
12
0 commit comments