Monday, 13 August 2018

Series-17

===========================================================================
                                CODING



#include<all.h>

void main()
{
    clrscr();
    double n=0,X=0,Y=0,SUM=0,i=1,sum=1,q=1;
    cout<<"\nEnter number: ";
    cin>>n;
    cout<<"\nEnter numerator variable: ";
    cin>>X;
    cout<<"\nEnter denominator variable: ";
    cin>>Y;
    cout<<"\n\n\n";
    do
    {
do
{
   sum=q*sum;
   q++;
}while(q<=pow(Y,i+1));
    SUM=pow(X,i)/sum+SUM;
    if(i<n)
    cout<<"("<<X<<"^"<<i<<")/("<<Y<<"^"<<i+1<<"!) + ";
    else
    cout<<"("<<X<<"^"<<i<<")/("<<Y<<"^"<<i+1<<"!) = ";
    i++;
    }while(i<=n);
cout<<SUM;
getch();
}




===========================================================================


                                OUTPUT


No comments:

Post a Comment