small factorial (Why wrong?)

#include<stdio.h>
long long int fact(int n);
int main()
{
int n,i,k*;
long int d*;
scanf("%d",&n);
for(i=0;i<n;i++)
{
if(1<=n<=100 && 1<=k<=100)
scanf("%d",&k*);
}
for(i=0;i<n;i++)
{
d*=fact(k*);
printf("%lld
",d*);
}
return 0;
}
long long int fact(int n)
{
if(n>=1)
return(n*fact(n-1));
else
return 1;
}

https://www.codechef.com/viewsolution/13353189

Check this. I hope you understand.

If you want to solve it using recursion. Have a look at:
https://www.codechef.com/viewsolution/15220161