Using Flag-Controlled While Loops
The following java program uses a Flag-Controlled While Loop. It uses a Boolean variable to control the loop. The variable such as found, which is used to control the execution of the
while loop
, is called flag variable. .