aiii guys,, here one example of a program to search results of n factorial i hope that it can help to finish up your problem.... _^ ........
#include <iostream>
#include <math.h>
using namespace std ;
int faktorial(int a);
int main ()
{
int n;
cout << "Masukkan bilangan : " ;
cin >> n ;
cout << "Faktorial " << n <<" = " << faktorial (n) ;cout << "\n";
}
int faktorial (int a)
{
int hasil ;
if (a <= 1)
{ hasil = 1; }
else
{ hasil = a*faktorial(a-1); }
return (hasil) ;
}
#include <math.h>
using namespace std ;
int faktorial(int a);
int main ()
{
int n;
cout << "Masukkan bilangan : " ;
cin >> n ;
cout << "Faktorial " << n <<" = " << faktorial (n) ;cout << "\n";
}
int faktorial (int a)
{
int hasil ;
if (a <= 1)
{ hasil = 1; }
else
{ hasil = a*faktorial(a-1); }
return (hasil) ;
}
perulangan rekursif ya..
BalasHapushmmm...