# include
using namespace std;
# include int main()
{
int x, n;
float sum = 0;
cout <<“Enter the value for x:”; cin>>x;
cout <<“Enter the number of terms”; cin>>n;
for (int i = 0; i<=n; i++)
sum = Sum + Pow(x,i);
cout << “Sum= ” << Sum << endl;
cin.get( );
return 0;
}