FCTRL2 Why is it showing wrong answer

The code is running properly on my ide, why is it showing wrong answer on submission?

#include<stdio.h>
int main()
{
int i,t,a[t],fact;
scanf("%d",&t);
for(int i=0;i<t;i++)
{ scanf("%d",&a[i]); }
for(i=0;i<t;i++)
{
fact=1;
while(a[i]>0)
{
fact=fact*a[i];
a[i]–;
}
printf("%d\n",fact);
}
}

//