Understanding continue and leave statement using simple do loop