Any loop in program may contain another loop inside it. A loop inside another loop is called a nested loop.
How it works is that first success condition of outer loop triggers the inner loop which runs and reaches the completion. This combinations of loops inside loop is helpful while working with requirements where user wants to work of multiple conditions simultaneously.