#include <cstdlib>
#include <iostream>
using namespace std;
long int fakto(unsigned int nil_n){
if(nil_n == 0|| nil_n == 1)
return 1;
else
return nil_n*fakto(nil_n-1);
}
int main(int argc, char *argv[])
{
int n;
cout<<"Inputkan nilai n = ";cin>>n;
long int hasil = fakto(n);
cout<<n<<"! = "<<hasil;
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
screenshot