Create a new class file with a main() method. Write a for-loop that adds numbers from x

Question:

Create a new class file with a main() method. Write a for-loop that adds numbers from x to y. For example, adding numbers from x = 1 to y = 5 should yield 1 + 2 + 3 + 4 + 5 = 15. Assume x is always smaller than y.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: