How do we know this loop stops?

The displayAd variable updates to false inside the code blockWe don't know if the loop stopsThe displayAd variable updates to true inside the code blockA display statement is inside the code block

The displayAd variable updates to false inside the code block.