Hi, I have been attempting a question for hours now and don't seem to be getting anywhere. I have to return a vector of <long> containing the arithmetic progression up to N terms, with a and d long arguments, so

a_n = a+n*d

I have created the function vector<long>arith_prog(long, long, int) like follows:

vector<long> arith_prog(long a, long d, int N)

{

vector<long>arith_vec;

long x = 0;

for( int i = 0; i < N; i++)

{

x = a + i*d;

arith_vec.push_back;

x = arith_vec[i];

}

return arith_vec;

}

Can anyone tell me where I am going wrong?

Quick reply would be great!

Thanks