#include <cstdlib>
#include <cstdio>
#include <iostream>
usingnamespace std;
int main()
{
cout << "This program sums multiple series of numbers.\n"
<< "Terminate eash sequence by entering a negative number.\n"
<< "Terminate the series by entering two nrgative numbers in a row\n\n";
int accumulator;
for(;;)
{
accumulator =0;
cout << "Start the next sequence\n";
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;
return 0;
}
the program runs but i am unable to exit the first loop