Welcome to the Ranch
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.