Java Program – to find the sum of natural numbers.

Output: