A while loop is used to execute a body of statements continually as long as the Boolean expression that controls entry into the loop continues to be true.
It is important that the loop control variable be altered within the body of the loop.The loop control variable is the value that determines whether loop execution continues.