Factorial! - Hackerearth Problem Solution - CODELABS3277

So with the hope that you have tried to solve this problem, if not then please give it a try before seeing the solutions.

If already tried then here we will be exploring numerous ways to solve this problem. Though it is a very basic problem from Basic Programming Section!


Given: Positive Integer, N
We need to find N!, it is also given that 1<=N<=10

It is important as for large numbers we will not be able to find the value of N! as it will require 100s of digit and we can't store such a huge number in C++ integers data type and due to overflow we will get the wrong answers.

In solution a = n.

C Solution: Method 1

By - PraveenKumarRana

If you find any error in explanation or in code does write in the comment section.  These are the code which I have written and submitted in Hackerearth.

Thank You
Happy Coding