Can't work this!!??a


Calculating this :z=(3n+m-2)!+(m+n)!!+ 2n!+2xy

I need your help :) Thank you


#include <iostream>
#include <iomanip>
using namespace std;
struct factorial
{
double x, y;
double factorial_function(double k,int h);

};
int main()
{
factorial alfa;
int m, n;
cout << "\nValue of m= ";
cin>>m;
cout << "\nValue of n= ";
cin>>n;
cout << "\nValue of x= ";
cin>>alfa.x;
cout << "\nValue of y= ";
cin>>alfa.y;

double z;
z=alfa.factorial_function(3*n+m-2,1)+alfa.factorial_function(m+n,2)+alfa.factorial_function(2*n,1)+2*alfa.x*alfa.y;
cout << "\nCalcualted value of Factorial z= " <<z <<endl;
return 0;
}
double factorial::factorial_function(double k, int h)
{

double f=1;
int i;
for(i=k;i>=i;i=i-h)
{
f=f*i;
}
return f;
}
Topic archived. No new replies allowed.