Okay, Do you know that factorial of 100 contains 24 zeros at the end only if we leave the middle ones. The problem is to how to store this long number.
/*C Program to calculate factorial of large numbers ~ MyCFiles.com*/
long long val;
typedef struct fact Fact;
long long temp=0,i,j,pro=0;
We created a program that can calculate the factorial of numbers 1 to 1,000. Yes. We have used array to store the large number. One condition of the program is that your compiler must be able to handle the array large enough to handle the factorial of 1,000. That’s why we used CodeBlock IDE the used GCC compiler. Anyways, if you clearly look at the program, you will see that program first stores all the factorials from 1 to 1,000 first, then asks you for Input. It is done because in some cases, you need to calculate the factorial in the given time limit. Believe me that if you are going to start from scratch, you are never going to end computing in time. But here is the trick, time starts from the instant you took the input, it means first compute the result of all the imputs, store it, then show it as wanted.
Use CodeBlock IDE because TC++ can’t handle large array size. Download CodeBlock mingw-setup from here.
If you are new to CodeBlock, I got certain things for you,
use Ctrl+F9 -> Compile
and use Ctrl+F10 -> Run
Comment bello for your Query and Feedback