can someone explain me series questions in java in the given image
Attachments:
Answers
Answered by
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 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