===========================================================================
CODING
#include<all.h>
void main()
{
clrscr();
double i,X,Y,n,N=0,W,sum;
cout<<"\nEnter number: ";
cin>>n;
cout<<"\nEnter Divident: ";
cin>>X;
cout<<"\nEnter Divisor: ";
cin>>Y;
cout<<"\n\n\n";
for(i=1,sum=0;i<=n;i++)
{
N=i;
sum=pow(X,i)/(Y+i-1)+sum;
if(N<=n-1)
cout<<"("<<X<<"^"<<i<<"/("<<Y<<"+"<<i-1<<")) + ";
else if(N==n)
cout<<"("<<X<<"^"<<i<<"/("<<Y<<"+"<<i-1<<")) = ";
}
cout<<sum;
getch();
}
CODING
#include<all.h>
void main()
{
clrscr();
double i,X,Y,n,N=0,W,sum;
cout<<"\nEnter number: ";
cin>>n;
cout<<"\nEnter Divident: ";
cin>>X;
cout<<"\nEnter Divisor: ";
cin>>Y;
cout<<"\n\n\n";
for(i=1,sum=0;i<=n;i++)
{
N=i;
sum=pow(X,i)/(Y+i-1)+sum;
if(N<=n-1)
cout<<"("<<X<<"^"<<i<<"/("<<Y<<"+"<<i-1<<")) + ";
else if(N==n)
cout<<"("<<X<<"^"<<i<<"/("<<Y<<"+"<<i-1<<")) = ";
}
cout<<sum;
getch();
}
===========================================================================
No comments:
Post a Comment