i have not been able to calculate factorial of longer numbers as there is no data type available to store such big no.

Plz tell me how to print factorial of big nos.

Printable View

- 09-30-2011nitin28how to print factorial of numbers upto 100
i have not been able to calculate factorial of longer numbers as there is no data type available to store such big no.

Plz tell me how to print factorial of big nos. - 09-30-2011CommonTater
long long int ... range -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

on most compilers written in the past 8 to 10 years long long int is 64bits. - 09-30-2011iceaway
For very large numbers you need bignum arithmetics, check out Arbitrary-precision arithmetic - Wikipedia, the free encyclopedia

- 09-30-2011grumpy
And that is insufficient to represent 100! (which has a value of just under 1.0E158). That would need at least a 525-bit integral type.

That is why some big integer representation (typically implemented as an array of unsigned or unsigned long, and a set of functions to operate on that representation) is needed.