CMPT 120 Lecture Notes - Lecture 4: Infinite Loop, Javascript, For Loop
Document Summary
) ; Generally the code with the loop has to change something so that the condition becomes false, or break out of the loop. While ( condition : difference between while and do/while is that while checks the condition before executing the code within the loop. For (init statement; condition; post loop statement) { Init statement is done prior to first iteration through the loop: condition is checked prior to each iteration of the loop, post loop statement is done after each iteration of the loop. For ( i = 0; i