CƁLCULO DE FATORIAL E VARIAVEIS | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

CƁLCULO DE FATORIAL E VARIAVEIS

Em um programa simples para cĆ”lculo de fatorial de um nĆŗmero n, usei como retorno para esta funĆ§Ć£o uma variĆ”vel "unsigned long long int", de 64 bits. Mesmo assim, nĆ£o Ć© possĆ­vel calcular fatoriais para nĆŗmero maiores que 20. Como proceder quando preciso de variĆ”veis ainda maiores? https://code.sololearn.com/ck72MjJ3yTp3/?ref=app

30th Oct 2017, 11:32 AM
Bruno Anastacio
Bruno Anastacio - avatar
4 Respostas
+ 8
Full translation (Google Translate) FACTOR AND VARIABLE CALCULATION In a simple program for factorial calculation of a number n, I used as a return for this function an "unsigned long long int" variable, 64 bits. Even so, it is not possible to calculate factorials for numbers greater than 20. How do I proceed when I need even bigger variables?
30th Oct 2017, 11:40 AM
jay
jay - avatar
+ 2
thank you
30th Oct 2017, 11:43 AM
Kustaa
+ 1
this is a good one. how can get in c++ factorials up to 20/30? I don't know the answer myself. is it the playground?
30th Oct 2017, 11:38 AM
Kustaa