Skip to content

Commit 91b3966

Browse files
authored
Added the Factorial Program
1 parent d4f6b3d commit 91b3966

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Factorial.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)