I need to write a program that sums, term by term, the following poylnomial.
p(x) = 1 + x + x^2 + x^3 + x^4 + ... + x^38
when x = 0.5
Here's the code I did, but the answer is completely wrong, lol:
#include <iostream>
using namespace std;
main()
{
int i, n;
float x;
x=0.5;
n=1;
for (i=0; i<38; i++)
{
n=n*i;
n=1+n;
}
cout<<"The sum term by term is: "<<n;
cin.get();
}
---
Also, it says write the code for the nested multiplication form of that...any idea there?
Thanks.

