//WAP TO DISPLAY X-X3+X5-X7......N
#include<iostream.h>
#include<conio.h>
void main()
{
	int i,j,k,x,n,p,sign=1;
	unsigned long sum=0;
	clrscr();
	cout<<"Enter x and n";
	cin>>x>>n;
	for(i=1,k=1;i<=n;i++,k+=2)
	{
		p=1;
		for(j=1;j<=k;j++)
		{
			p=p*x;
		}
		p=p*sign;
		sum+=p;
		sign=sign*-1;
	}
	cout<<"\nSum of series is :"<<sum;
	getch();
}