#include<iostream>

#include<math.h>

using namespace std;

int main()

{

int x,n,sum;

sum=0;

cout<<“ENter the x: “;

cin>>x;

cout<<“Enter the n: “;

cin>>n;

for(int i=1;i<=n;i++)

{

cout<<pow(x,i)<<“\t”;

sum=sum+pow(x,i);

}

cout<<“\n sum of all is”<<sum;

}