CÁLCULO DE FATORIAL E VARIAVEIS | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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