Um. Have you looked at your code?
answer = 1/1+sum_of_series(n-1);
Operator precedence says that is:
answer = (1/1)+sum_of_series(n-1);
since you want:
1+1/2-1/3+1/4...
you need to start by using 1/N at some point... Then you can worry about the sign changing...