I am posting this response also includes the results of my exam yesterday as discrete mathematics.

Please know the following is the calculation formula of permutations:



sourcecode:

[sourcecode]
#include <iostream.h>
#include <conio.h>

class per{
public:
masukan();
proses();
private:
int n,r,i;
int faktorn,faktorr;
};

per::masukan(){
cout<<"\t\tProgram Permutasi "<<endl;
cout<<"Masukan n = ";
cin>>n;
cout<<"Masukan r = ";
cin>>r;
}
per::proses(){
faktorn=1,faktorr=1;
for(i=n;i>0;i--){
faktorn=faktorn*i;
}
for(i=n-r;i>0;i--){
faktorr=faktorr*i;
}
cout<<"Permutasinya "<<faktorn/faktorr<<endl<<endl;
cout<<"http://yusufruli.wordpress.com";
}

int main(){
per x;
x.masukan();
x.proses();

getch();
return 0;
}
[/sourcecode]