i have trouble with the output of this code [closed]

  c++, math

This is the the code I wrote in C++ for getting 100!.
I used double cause 100! is big and can’t be fitted in int and long long int.
but the output is different with the 100! answer and I couldn’t find any problem in it.

int main()
{
    double a=1;
    for(int i = 2;i <=100;i++)
    {
        a*=i;
    }
    printf("%lfn", a);
    return 0;
}

if you have a solution in mind please share!

Source: Windows Questions C++

LEAVE A COMMENT