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 Answers
+ 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