help me in detecting where did I go wrong

//to find factorial of a small no.

#include

using namespace std;

int main(){

int t;

cin>>t;

for(int i=1; i<=t; i++){

   int n;

   cin>>n;

   int fact=1;

    for(int j=2; j<=n; j++){

                fact=fact*j;

    }

   cout<<fact<<endl;

   

}

return 0;

}