using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
cout << "This program sums multiple seriesn"
<< "of numbers. Terminate each sequencen"
<< "by entering a negative number.n"
<< "Terminate the series by entering twon"
<< "negative numbers in a rown";
int accumulator;
for(;;)
{
accumulator = 0;
cout << "Start the next sequencen";
for(;;)
{
int nValue = 0;
cout << "Enter next number: ";
cin >> nValue;
if (nValue < 0)
{
break;
}
accumulator += nValue;
}
if (accumulator == 0)
{
break;
}
cout << "The total for this sequence is "
<< accumulator
<< endl << endl;
}
cout << "Thank you" << endl;
system("PAUSE");
return 0;
}