What is wrong with the following code, which attempts to add all numbers from 1 to a

Question:

What is wrong with the following code, which attempts to add all numbers from 1 to a given maximum? Describe how to fix the code.

public static int sumTo (int n) { for (int i = 1; i

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

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: