Program Faktorial

#include iostream;

using namespace std;

int faktorial(int n){
    int k,fak;
    fak=1;
    for(k=1; k<=n; k++){
             fak=fak*k;
             }
    return fak;
    }

int main(){
    int n;
    cout<<"Masukkan nilai n = ";
    cin>>n;
    cout<<"Nilai n! = "<<faktorial(n);
    cout<<endl;
    system("PAUSE");
    return 0;
    }

Baca Juga :   Augmented Reality for Android (part 2)