Basic
Prevent iterator from moving forward in for loop.
for loop.char ch;
for(int i = 1; i <= 10; i++){
cout << "Iteration " << i << endl;
cout << "repeat iteration (y/n): ";
cin >> ch;
if(ch == 'y')
i--;
}Last updated