Pular para o conteúdo principal

Postagens

Mostrando postagens com o rótulo Unsigned

Fatorial recursivo, Unsigned, long, if((n==1)

#include #include using namespace std; unsigned long fatorial_recursivo (int n){ unsigned long resposta; if ((n == 1) || (n == 0))return(1); resposta = n * fatorial_recursivo(n - 1); return(resposta); } int main() { unsigned long f; int n; cout<<"Digite um número: \n"; cin >> n; f = fatorial_recursivo(n); cout<<"O fatorial de "< system("PAUSE > null"); return 0; }