i have an assignments and i don't know how i can do it and make the equation
can you help me please?
Create a program using a for-loop to calculate the value of pi from the infinite series:
pi = 4 – (4/3) + (4/5) – (4/7) + (4/9) – (4/11) + . . .
Allow the user to specify the number of series of computations to approximate the
values of pi.
You realise that series will evaluate to 3? The reason is that all the divisions are in integer format; the first division will evaluate to 1 and the others to 0. You need to use floating‑point division:-The divisors can be denominated as integers which makes the loop easier to write; the runtime will convert them to floating‑point automatically. The poor precision of floating‑point arithmetic means you will never get an accurate value for π, but you can still get full marks.