Replace Loops using Recursion - The Way I Understand It

You don’t actually start to sum the elements until n gets to zero. After n = 0 then you start returning and adding the values.

Like with the loop, you iterate n amount of times.

PD: Never mind, thought I was wrong because I had an error, I used parenthesis instead of brackets with the array haha [EDIT] Image fixed

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.