logo CodeStepByStep logo

SumTo

What is wrong with the following SumTo function, which attempts to add all numbers from 1 to a given maximum? Correct the code so that it properly implements this behavior. For example the call of SumTo(5) should return 1+2+3+4+5 = 15. You may assume that the value passed is at least 1.

Function: Write a VB function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.