## FCTRL2 - Small factorials

You are asked to calculate factorials of some small positive integers.

### Input

An integer t, 1<=t<=100, denoting the number of testcases, followed by t lines, each containing a single integer n, 1<=n<=100.

### Output

For each integer n given at input, display a line with the value of n!

Sample input:
```4
1
2
5
3
```

Sample output:

```1
2
120
6```

## Code Examples

### #1 Code Example with Java Programming

```Code - Java Programming```

``````import java.util.*;
import java.math.*;
class fctrl2
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int no=sc.nextInt();
BigInteger[] a=new BigInteger[no];
for(int i=0;i<no;i++)
{
a[i]=fact(sc.nextInt());
}
for(int i=0;i<no;i++)
{
System.out.println(a[i]);
}
}
public static BigInteger fact(long b)
{
BigInteger c= BigInteger.valueOf(1);
for(int i=1;i<=b;i++)
{
c=c.multiply(BigInteger.valueOf(i));
}
return c;
}
}``````
Copy The Code &

Input

cmd
4
1
2
5
3

Output

cmd
1
2
120
6