#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;
}
#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;
}
Comentários
Postar um comentário