Small Factorial (What's wrong with this code?)

factorial

#1

#include
using namespace std;
int factorial(int);
int main()
{
int t;
cin>>t;
int a[t],fact;
for(int i=0;i<t;i++)
{
cin>>a*;
}
for(int i=0;i<t;i++)
{
fact=factorial(a*);
cout<<fact<<"
";
}
return 0;
}

int factorial(int num)
{
if(num<=1)
return 1;
else
return num*factorial(num-1);
}