this program is in accordance with question but it shows as wrong answer , even every time i try to submit my solution on codechef it says wrong answer
//program to find the factorial of the list of numbers given
#include
using namespace std;
int main()
{
int t; //to input the number of test cases
cin>>t;
int arr[100];
for(int i=0;i<t;i++)
{
cin>>arr[i];
}
int fact;
for(int j=0;j<t;j++)
{ fact=1;
for(int k=arr[j]; k>1;k–)
{
fact=fact*k;
}
cout<<fact<<"\n";
}
}