for (int j = -1; j < 2; j++) for (int i = -1; i < 2; i++) if (i==0 & j==0) break; 

In this case, the program will be released from both cycles or only from internal?

UPDATED The desired result is achieved only with the use of brackets:

  for (int j = -1; j < 2; j++){ for (int i = -1; i < 2; i++){ if (i==0 & j==0) break; } if (i==0 & j==0) break; } 
  • one
    Can't you check it yourself? - vikttur
  • You can use the label - zRrr
  • This is a trivial question, and the label complicates it. - sapeg

1 answer 1

Although with parentheses, even without, the break statement only exits the inner loop.

  • Respectively i = 0 and j = 0 I do not get with this code? - sapeg