#include<stdio.h>

long int f(int);

int main()

{

int t,n;

scanf("%d",&t);

if(t>=0 && t<=100)

while(t)

{scanf("%d",&n);

if(n>=0 && n<=100)

printf("%ld\n",f(n));

else return 0;

t–;

}

return 0;

}

```
long int f(int n)
{ if (n==1 || n == 0)
return 1;
else
return n*f(n-1);
}
```