//W.A.P TO SOLVE THE FOLLOWING: x+x2+x3+_____+xn
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x,n;
unsigned long p,i,j,sum=0;
cout<<"\n Enter x=";
cin>>x;
cout<<"\n Enter n=";
cin>>n;
for(i=1;i<=n;i++)
{
p=1;
for(j=1;j<=i;j++)
p=p*x;
sum+=p;
}
cout<<"\n Sum of series="<<sum;
getch();
}