Link to problem: https://www.codechef.com/problems/FCTRL2

#include <stdio.h>

long int fact(int n)

{

if (n==0)

{

return 1;

}

else

return n * fact(n-1);

}

int main(void) {

//Calculate Factorial

int i, t;

long int res;

scanf("%d", &t);

while(t–)

{

scanf("%d", &i);

res = fact(i);

printf("%d\n", res);

}

return 0;

}