I need help with using continue in my loop.
they say that when using continue in the loop that is nested,
depending on the condition of the continue statement, execution
should jump to the original loop statement and i am having trouble
doing that........... please refere to the code below:
they say that when using continue in the loop that is nested,
depending on the condition of the continue statement, execution
should jump to the original loop statement and i am having trouble
doing that........... please refere to the code below:
Code:
#include <iostream>
using namespace std;
int main()
{
int x, y;
for(x=0; x>=-50000; x--) {
cout << x << "\n";
if(y>10000) continue; // my continue statement says that the loop below should stop at 10000, but it doesnt, it continues all the way to 20000
for(y=0; y<20000; y++) { // this
cout << y << "\n";
}
}
cin.get();
return 0;
}
Comment