Your for loop needs to have i as its variable since you have declared it and not j.

You don't have a question to answer but I'll give some advice anyway. First, write a function to compute the factorial of a value. That will provide the denominator for each value in the series. The rest of this will be a simple division of values and summing the results inside a for loop.

The only semi-tricky thing here is the alternating addition and subtraction. You can do that several ways. One is to use a multiplier and alternate it from +1 to -1. Another is to have a boolean flag that alternates from true to false and tells you whether you should add or subtract the result. Yet another is to determine addition or subtraction based on whether to loop index is odd or even which you can find taking modulo 2 of the loop index.

15,435,704 members

^{hris}L^{osinger}25-Oct-17 13:27pm`2i/i + 1`

would mean`(2i/i) + 1`

, not`2i/(i+1)`

; * Except I don't think C lets you multiply a variable by a number without specifying the multiplication operator (`2 * i`

); *`2 * i/(i + 1)`

is nowhere near the same thing as`i/(i + 1)!`

- multiplying by 2 is not the same as taking the factorial[^] of the divisor; * The sequence is supposed to alternate between adding and subtracting the terms. * And to top if off, you're not even using the loop variable!