Skip to content

Commit b9436a6

Browse files
authored
Merge pull request codec-akash#7 from SHUBH619/patch-1
Create factorial.java
2 parents 61d3432 + bcfcfef commit b9436a6

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+
import java.util.*;
2+
public class factorial{
3+
4+
public static void main(String args[])
5+
{
6+
Scanner s=new Scanner(System.in);
7+
int n=s.nextInt();
8+
long f=1;
9+
10+
for(int i=1;i<=n;i++)
11+
f=f*i;
12+
System.out.println(f);
13+
14+
}
15+
16+
}

0 commit comments

Comments
 (0)