// NOTE: use break to exit loop, continue to skip one iteration
int a = 0;

while (a < 5) {
    // do something
    a++;
}

// or
do {
    // do something
    a++;
} while (a < 5);