U
U
Umid2016-11-16 11:55:42
Mathematics
Umid, 2016-11-16 11:55:42

Is it possible to print the factorial of 10000 in C++?

You need to print the factorial of 10000.
While unsigned long long is only capable of factorial of 65 ((

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
romy4, 2016-11-16
@DarCKoder

like everything is possible. gmp

G
GavriKos, 2016-11-16
@GavriKos

Withdraw? Yes, for God's sake, consider in some sort of matkad, save to a string, output.
But if you count - google work with large numbers, there are your own approaches, with breaking the number into orders and the corresponding logic of mathematical operations.

P
Peter, 2016-11-16
@petermzg

Alternatively, storing the value in a row, multiplying in a column.

R
Rou1997, 2016-11-16
@Rou1997

And more is possible, this is long arithmetic, it’s quite easy to implement it yourself, dynamic arrays of numbers, and an algorithm such as in a school column, but the array will take up a lot of memory space, so make sure that intermediate results are deleted except for the last one, and if the RAM is still not enough then have to use the file on the hard drive, but it's slow, especially if the HDD.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question