how do I compute the sum?

1. Prompt the user Enter a positive number or 0 to quit:
2. Extract the number into int n
3. If the users enters 0, the program should finish.
4. Otherwise compute the sum
s = 3 + 4/( 2·3·4) − 4 / (4·5·6) + 4 / (6·7·8) − 4 (8·9·10)+ ...± 4 (2n·(2n + 1)·(2n + 2))

5. Print the value of the sum on one line.
6. Print the value of PI on the line below.
What have you coded?
have you coded anything so far? try using a for loop to calculate s.
Do you speak spanish?
If is true i can help you better :v

if not:
wut? the sum that you have i don't understand, in the center have "... ±" what is the mean of this?

I havent tried anything, I dont understand very well, I need like a very good explanation with a similar example, and yes I do speak spanish.
#include "std_lib_facilities.h"
int main ()
{
int n;
while (true)
{
cout << "Enter a positive number or '0' to quit.\n";
cin >> n;
if (n == 0)
{
cout << "The program has finished.\n";
break;
}
else
{

}


I dont know what to do inside "else".
Topic archived. No new replies allowed.