Pow function using repetitive addition

hi there! i badly need some help on this:

implement a power function that uses repetitive addition. i'm thinking there should be nested loops....please help me.

thanks a lot!
Last edited on
I'll walk you through getting started.

You know you need to write a function. You know the function should return a value (the result). A number to a power seems to be 2 separate values; so your function needs to take two parameters. Inside the function, you'll have to do some addition a number of times (by using a loop, like you suggested).

Give it a shot and post your code here when you have a specific problem.
Last edited on
Topic archived. No new replies allowed.