hi guys

I want help in solving this question

the power series for In(x) ( 0<x<2) for up to 1000 terms is:

In(x)=(x-1)-(x-1)^2/2+(x-1)^3/3-(x-1)^4/4.......-(x-1)^1000/1000

write the C++ code of the tWo functions GetValueofvar() and GetLogofVar(var) in the following main program:

void main(){
         double var;
         double x;
         var=GetValueofvar();
         x=GetLogofVar(var);
}

where
get value of var() returns the value for which the In will be calculatd. within this function, the user should be prompoted to enter the value of var
_getlogoVar(var) returns the value of In(x) as approximated in equation of In(x) above

that looks like the log function, "L"n (LN) not "I"n (IN). That should be a good place to start. You seem not to have attempted to write that part of the code at all. Give it a shot and let us know how it goes.

Dave

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.