Java Program – a simple demonstration of using While Loop.

Output: