why is this code wrong??
#include<stdio.h>
int main(){
int t;
scanf(“%d”,&t);
int a[t];
for(int i=0;i<t;i++)
{
scanf(“%d”,&a[i]);
}
for(int i=0;i<t;i++)
{
int prod=1,b=1;
for(int j=i;b<=a[j];b++)
{
prod=prod*b;
}
printf("%d\n",prod);
}
return 0;
}
the output is correct but while submitting it is showing wrong answer.