# Small factorials Problem Code: FCTRL2

**URL:** <https://discuss.codechef.com/t/small-factorials-problem-code-fctrl2/98134>\
**Category:** help\
**Tags:** c-plus-plus\
**Created:** [January 11, 2022, 11:38am UTC](https://discuss.codechef.com/t/small-factorials-problem-code-fctrl2/98134 "2022-01-11T11:38:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![devverma\_712](https://discuss.codechef.com/user_avatar/discuss.codechef.com/devverma_712/32/217515_2.png) [@devverma\_712](https://discuss.codechef.com/u/devverma_712)\
**Post date:** [January 11, 2022, 11:38am UTC](https://discuss.codechef.com/t/small-factorials-problem-code-fctrl2/98134/1 "2022-01-11T11:38:42Z")

</div>

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

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;

```

}

---

<div class="post-metadata">

**Author:** ![ssjgz](https://discuss.codechef.com/user_avatar/discuss.codechef.com/ssjgz/32/346011_2.png) [@ssjgz](https://discuss.codechef.com/u/ssjgz)\
**Post date:** [January 11, 2022, 11:42am UTC](https://discuss.codechef.com/t/small-factorials-problem-code-fctrl2/98134/2 "2022-01-11T11:42:34Z")

</div>

Please search the forums - there are countless threads on this 🙂

Here’s one from just yesterday: [Small factorials Problem Code: FCTRL2](https://discuss.codechef.com/t/small-factorials-problem-code-fctrl2/98109)

> [@devverma\_712](#):
>
> i tried all the situation

Clearly not 🙂

---

<div class="post-metadata">

**Author:** ![devverma\_712](https://discuss.codechef.com/user_avatar/discuss.codechef.com/devverma_712/32/217515_2.png) [@devverma\_712](https://discuss.codechef.com/u/devverma_712)\
**Post date:** [January 11, 2022, 12:07pm UTC](https://discuss.codechef.com/t/small-factorials-problem-code-fctrl2/98134/3 "2022-01-11T12:07:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![iamriya](https://discuss.codechef.com/user_avatar/discuss.codechef.com/iamriya/32/24644_2.png) [@iamriya](https://discuss.codechef.com/u/iamriya)\
**Post date:** [January 11, 2022, 5:36pm UTC](https://discuss.codechef.com/t/small-factorials-problem-code-fctrl2/98134/4 "2022-01-11T17:36:20Z")

</div>

check this out:[Computing Factorials of a huge number in C/C++: A tutorial](https://discuss.codechef.com/t/computing-factorials-of-a-huge-number-in-c-c-a-tutorial/1727)  
Though its not for c++ but you will get the logic!
