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.
#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
{