include<stdio.h>long long int fact(int n); int main() { int n,i,k[i]; long int d[i]; scanf("%d",&n); for(i=0;i<n;i++) {="" if(1<="n<=100" &&="" 1<="k<=100)" scanf("%d",&k[i]);="" }="" for(i="0;i<n;i++)" {="" d[i]="fact(k[i]);" printf("%lld\\n",d[i]);="" }="" return="" 0;="" }="" long="" long="" int="" fact(int="" n)="" {="" if(n="">=1) return(n*fact(n1)); else return 1; } asked 02 Sep '17, 17:34

https://www.codechef.com/viewsolution/13353189 Check this. I hope you understand. answered 02 Sep '17, 17:46

If you want to solve it using recursion. Have a look at: https://www.codechef.com/viewsolution/15220161 answered 02 Sep '17, 17:49
