sir can you tell me why this program is wrong

Problem Code: FCTRL2
#include<stdio.h>
int factorial(int n)
{
return(n == 1 || n==0) ? 1: n * factorial(n -1);

}
int main()
{
int i,t,n[100];
scanf("%d",&t);
for(i=1;i<=t;i++)
{
scanf("%d",&n[i]);
}
for(i=1;i<=t;i++)
{
printf("%d \n",factorial(n[i]));
}

return 0;

}

Hi, Your approach is only correct for small values of n say till n=12 then the factorial answer cant be stored in int variable ,hence your approach is wrong

Hint:Try using array for storing the product (one digit in one array position).Hope this helps