Write a program to calculate the result of the formula pi in java π=4(1β1/3+1/5β1/7+1/9β1/11+1/13ββ―β1/2πβ1+1/2π+1) with 10000 β€ i β€ 100000
public static void main(String[] args) { double i = 10000; double pi = 4; double p = 0; while (i <= 100000) { p = p + 4 / i - 4 / (i + 2); i = i + 4; } System.out.println("The result of the formula pi with i = 100000 is " + p); }