Assumptions
 Â
1. n is an integer.
 Â
2. Language is c++
   Â
double expr(double x, int n)
 Â
{
 Â
double sum = 0.0;
 Â
double power = 1.0; // Will have the value x^y where y ranges from 0 to n
 Â
int i;
   Â
for(i=0; i <= n; ++i) {
 Â
sum += power;
 Â
power *= x;
 Â
}
 Â
return sum;
 Â
}