You have to print the factorial just after the entered number.
import java.util.*;
public class FCTRL2 {
public static void main(String[] args) {
FCTRL2 ob=new FCTRL2();
Scanner sc=new Scanner(System.in);
int t,n,i,j,f=1,a[];
t=sc.nextInt();
a=new int[t];
for(i=0;i<t;i++)
{
n=sc.nextInt();
for(j=1;j<=n;j++)
{
f=f*j;
}
//a[i]=f;
System.out.println(f);
f=1;
}
/*for(i=0;i<t;i++)
{
System.out.println(a[i]);
}*/
}
}