We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d4f6b3d commit 91b3966Copy full SHA for 91b3966
1 file changed
Factorial.java
@@ -0,0 +1,16 @@
1
+# https://www.facebook.com/bhavesh.thale.1/posts/1517693698431445
2
+# Subscribed by Code House
3
+public class Factorial {
4
+
5
+ public static void main(String[] args) {
6
7
+ int num = 10;
8
+ long factorial = 1;
9
+ for(int i = 1; i <= num; ++i)
10
+ {
11
+ // factorial = factorial * i;
12
+ factorial *= i;
13
+ }
14
+ System.out.printf("Factorial of %d = %d", num, factorial);
15
16
+}
0 commit comments