Sum of Powers

Basic Exercise

Statement

Create an application that will calculate the output of the function $S=N+N^{2}+N^{3}+...+N^{M}$ where $N$ and $M$ are positive integers inputted by the user

Suggested Concepts:

• Dim - Declares variables.
• For Next - Repeats a group of statements a specified number of times.
• Function - Function will return a value.

Remember that in most cases there is more than one way to solve the exercise.

Hint: Create a Loop that runs from 1 to $M$. Every new term equals $N$ raised to the $i$^th power