hello there, I'm new to these boards, and also very new to programming, so I hope you could help me out

I'm currently writing a program (in C) that requires me to sum the values of a function from 2 up to (N-1).

now I've had a search on the net and come across this "accumulate" thing, which seems to do exactly what I want! one problem though, it seems to be a C++ command, rather than one for C.

now I know how to get a loop to run from 2 up to (N-1) by doing something similar to this;

(and yes, that doesn't work as it is but hopefully it'll give an idea of what I want to do)Code:{ for (i=2; i<=(N-1); i++); /* b is the sum of all values of f(xi) from i=2 to i=(N-1) */ { f(xi); } }

but I really dont know how to get every consecutive value of my function to sum together... Am I going to have to input every value of the loop into some sort of array to get around this problem...?

Also, dont know whether this will make a difference, but I'm going to have to take N up to as large a value as possible to give a vague approximation of infinity

thanks very much for any help you can offer