this is the code
#include
using namespace std;
int multiply( int *res, int x, int res_size)
{
int carry=0,i,prod;
for(i=0;i<res_size;i++)
{
prod=res[i]*x+carry;
res[i]=prod%10;
carry=prod/10;
}
while(carry)
{
res[res_size]=carry%10;
carry=carry/10;
res_size++;
}
return res_size;
}
int main() {
int n;
int res[500];
int res_size=1,x,i;
res[0]={1};
cin>>n;
if(n==1)
cout<<β1β;
else
{
for (x=2;x<=n;x++)
res_size=multiply( res, x,res_size);
for (i=res_size-1;i>=0;iβ)
cout<<res[i];
}
return 0;
}
this is the code i found but i honestly do not understand how it works so please explain