Need a project done?

C++ Programming Developer

Search This Blog

Question:



#include<iostream>
using namespace std;

int fact(int);
long double Series(int,int);

int N,K;

int main()

{
cout<<"Enter 2 Numbers followed by space "; cin>>N>>K;
cout<<"Series = "<<Series(N,K)<<endl;

 return 0;
}
//Factorial Calculator
int fact(int N)
{
int Num = 1;
for (int i=1; i<=N; i++)
Num *= i;
return Num;
}
//Series Calculator
long double Series(int N,int K)
{
return  ((fact (N))/((fact(K))*(fact(N-K))));

}

No comments:

Post a Comment

"Don't let anyone ever make you feel like you don't deserve what you want."