#include<stdio.h>
//#include
int fac(int);
int main()
{
int i;
scanf("%d",&i);
int n;
int k;
int fact;
for(k=0;k<i;k++)
{
scanf("%d",&n);
fact=fac(n);
printf("%d\n",fact);
}
}
int fac(int x)
{
int f;
if(x==1)
return(1);
else
f=x*fac(x-1);
return(f);
}
this code is giving right answer on my comp