Computer Science, asked by howtoberich04, 5 months ago

can someone explain me series questions in java in the given image

Attachments:

Answers

Answered by allysia
0

Explanation:

The main program begins at

  • double p=0 ; :  assigns p a float value of 0.
  • for (int i =0; i<=n; i++) : Begins a for loop and runs it n+1 times, every time increasing i by 1.
  • p =p + double(Math.pow(x,i)/i); : increases p by \frac{x^{i} }{i}  every time the loop runs.
  • Math.pow(x,i): returns x raised to the power of i.
  • System.out.println("p="+p) : print the last value of p since it is out of hte loop brackets {}.

Similar questions