Java useslooping constructsto control program flow. When writing programs, certain tasks must be repeated a specific number of times or until a certain condition is met. Loops are programming constructs that simplify just such repetitive tasks. There are three main types of loops: For, While, an...
Last statement in the block ensures that, with every execution of loop,loop control variable moves near to the termination point. If this does not happen then the loop willkeep on executing infinitely. As soon asibecomes 11, condition inwhilewill evaluate toFalseand this will terminate the loop...