forked from codehouseindia/Java-Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFactorial.java
More file actions
16 lines (14 loc) · 418 Bytes
/
Factorial.java
File metadata and controls
16 lines (14 loc) · 418 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# https://www.facebook.com/bhavesh.thale.1/posts/1517693698431445
# Subscribed by Code House
public class Factorial {
public static void main(String[] args) {
int num = 10;
long factorial = 1;
for(int i = 1; i <= num; ++i)
{
// factorial = factorial * i;
factorial *= i;
}
System.out.printf("Factorial of %d = %d", num, factorial);
}
}