Problem Code: FCTRL2 . It is showing wrong ans. can you please tell me what is wrong in the program.

https://www.codechef.com/viewsolution/20417671

Factorial of large numbers cannot be stored in long long int range, therefore, you will get wrong answer for factorial of numbers greater than 22 so you need to store the digits of numbers in array separately.

You can look at my solution. Link

You can read more about the concept here. Link

but when you will run the program it will give you output for int between 1 to 100.

Output for 21 will be 1.124e+21 i.e. you are losing precision here you need exact answer with digits. Read the concept link to know more !!