Java Program – to find the sum of natural numbers using a while loop.

Output: