You could extract the loops out to a separate function and use return.
void doTheLoop(int n, int m) {
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
if (some condition) {
// Do something and break...
return;
}
}
}
}
doTheLoop(n, m);
//blablabla ...