#include<iostream>
using namespace std;
int main ()
{
int x, y, z, m, n, r;
int o;
int fac(int n);
cout<<"number of man:";
cin>>n;
x= fac(n);
cout<<"number of thing:";
cin>>r;
y= fac(r);
z= n-r;
o = fac(z);
m = o*y;
n = x/m;
cout<<"total possible combination among them:"<<n;
return 0;
}
int fac(int n)
{
int a=1;
for(int i=1; i<=n; i++)
{
a= a*i;
}
return a;
}
*************************************************
output:
using namespace std;
int main ()
{
int x, y, z, m, n, r;
int o;
int fac(int n);
cout<<"number of man:";
cin>>n;
x= fac(n);
cout<<"number of thing:";
cin>>r;
y= fac(r);
z= n-r;
o = fac(z);
m = o*y;
n = x/m;
cout<<"total possible combination among them:"<<n;
return 0;
}
int fac(int n)
{
int a=1;
for(int i=1; i<=n; i++)
{
a= a*i;
}
return a;
}
*************************************************
output:
Comments
Post a Comment