Not at all.

Your snipplet does nothing.
If you set j and z to true, you have an endless loop.

here a for how it's used normally


main() {
int i=0;