The correct way to break out of multiply nested control constructs (using the example in the referenced article) without using 3 separate boolean flags is: i=1; while(...){ ... for(...;...;...){ ... switch(...){ ... goto Out; } } } Out: i=2;