+ 3
The cout part it is never reached: Consider the 1st iteration in which a is 2. It meets the if condition so the iteration is stopped ("continue"). It will go to the next iteration but a is still 2, it wasn't changed – hence the same happens again. And again. It's an infinite loop.
28th Jan 2022, 9:42 PM
Lisa
Lisa - avatar