Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 2
    This is not a loop at all but some cout statements executed sequentially. In the second iteration j == 1 and the loop will be exited Commented Mar 1, 2021 at 10:29
  • 1
    You never hit the if (j == 5) break; condition. Commented Mar 1, 2021 at 10:30
  • @Caleth It doesn't even hit if (j == 2), because it will always break in the second iteration. Commented Mar 1, 2021 at 10:31
  • 1
    For some reason I was thinking continue not break Commented Mar 1, 2021 at 10:31
  • 1
    You have asked a very basic question, yet with a powerful concept. Commented Mar 1, 2021 at 10:41