In a For loop, the programmer should know the exact number of iterations the loop must perform before writing the code. The While loop gets its name from the way it works: While a condition is false, do some task. The conditions that control a loop repetition are Boolean expressions.