Please check the following program and find where is it going wrong. I matched the result from online factorial calculators and it is correct.

```
#include<iostream>
using namespace std;
double fact(int n)
{
double value=1.0;
if(n==0)
return(value);
else
{
value=n*fact(n-1);
return(value);
}}
int main()
{
int t,n[100];
cin>>t;
double result;
if(t<=100&&t>=1)
{
for(int i=0;i<t;i++)
{
cin>>n[i];
}}
cout<<endl;
for(int i=0;i<t;i++)
{
result=0.0;
if(n[i]>=1&&n[i]<=100)
{
result=fact(n[i]);
cout<<result<<endl;
}
}
return 0;
}
```