negru 0 Light Poster

Hi.

I need help with the following C program:
How to print first member of sequence so that condition
|a(n)-a(n-1)|<EPS is true, where EPS is a random input precision (double value).
Sequence a(n) is given by:
a(n)=(1-1/2!)(1+1/3!)...(1+(1/(n+1)!))

I tried to cancel factorial in the expression a(n)-a(n-1)=((-1)^n(n+2))/(n+1)!, but I don't know how.

Thanks for replies.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.