Small factorials Problem Code: FCTRL2

#what is hell is wrong there, i tried all the situation and still it showing WA all the time

using namespace std;

int main()


int numberofcases;

cin >> numberofcases;

while (numberofcases--)


    int num;
    unsigned long long int total =1;

    int count = num;

    cin >> num;


    for (int i = 1; i <= num; i++)


        total *= i;


    cout << total <<endl;


return 0;


Please search the forums - there are countless threads on this :slight_smile:

Here’s one from just yesterday: Small factorials Problem Code: FCTRL2

Clearly not :slight_smile:

1 Like

got the mistake of 13! but how can i print 100! ???

check this out:Computing Factorials of a huge number in C/C++: A tutorial
Though its not for c++ but you will get the logic!

1 Like