Example 4.11.5 missing brackets

image
Definitely minor but I think the while needs brackets around i++