You can of course recurse in any fashion you like. For example, to compute Fibonacci numbers in the naive way, you have a recursion that necessarily branches extremely fast:
inf fib(int n)
{
//... base case
int a = fib(n - 1);
int b = fib(n - 2);
return a + b;
}
You can also write return fib(n-2) + fib(n-1);, but the point is that you cannot eliminate the recursive branching in this case.
On the other hand, what you really want to try and achieve is tail recursion, by which the final statement is nothing but the recursive call. For instance, your summation could be written as:
void sum(int n, int & result)
{
if (n = 0) return;
result += n;
sum(n - 1, result);
}
The key feature of this special case is that the recursion can take place entirely in-place. Generally, the stack grows as (B − 1)n, where n is the recursion depth and B is the number of parallel evaluations. This is exponential (read: bad), unless you have B = 1, in which case one can try and design the function as tail recursion.