Question: Post in C language. pi = sqrt(12) * (1 (1/(3 3^1)) + (1/(5 3^2)) - (1/(7 3^3)) + (1/9 3^4)) ) 16.28 Lab 4, P3(T):

Post in C language. pi = sqrt(12) * (1 (1/(3 3^1)) + (1/(5 3^2)) - (1/(7 3^3)) + (1/9 3^4)) )
16.28 Lab 4, P3(T): Pi approximation This lab will be available until February 11th, 2:00 PM MST The value of n can be approximated using the Madhava formula pi = sqrt (1 -(1/(3-3-1)) + (1/(5 - 3^2)) - (1/(7.343)) + (1/9. 3^4))...) Write a C program that calculates the value of pi with a variable level of accuracy. For instance, if the desired accuracy is 10^-6, the absolute difference between the true value of n (see below) and the approximation from your function is less than 10^-6 Develop a function called pivalue that receive as input the numerical accuracy (in number of digits) and returns the calculated pi value. double pivalue (int numAccuracy); Sample Output: To what precision do you wish to calculate Pi? 4 pi = 3.14167431, within accuracy of 1E-4. Error = 0.00008166 301608.1764500 LAB ACTIVITY 16.28.1: Lab 4, P3(T): Pi approximation 0/4 main.c Load default template... 1 #include 2 #include 3 #define PI 3.141592653589793238462643383 5 double piValue(int numAccuracy); int main(void) { HBBBBB 9 //develop your code here and call the piValue 10 11 12 return(0); 13 } 15 double piValue(int numAccuracy) { 16 //approximate the value of piusing the Madhava formula 17 18 } Develop mode Submit mode Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the vendbou 16.28 Lab 4, P3(T): Pi approximation This lab will be available until February 11th, 2:00 PM MST The value of n can be approximated using the Madhava formula pi = sqrt (1 -(1/(3-3-1)) + (1/(5 - 3^2)) - (1/(7.343)) + (1/9. 3^4))...) Write a C program that calculates the value of pi with a variable level of accuracy. For instance, if the desired accuracy is 10^-6, the absolute difference between the true value of n (see below) and the approximation from your function is less than 10^-6 Develop a function called pivalue that receive as input the numerical accuracy (in number of digits) and returns the calculated pi value. double pivalue (int numAccuracy); Sample Output: To what precision do you wish to calculate Pi? 4 pi = 3.14167431, within accuracy of 1E-4. Error = 0.00008166 301608.1764500 LAB ACTIVITY 16.28.1: Lab 4, P3(T): Pi approximation 0/4 main.c Load default template... 1 #include 2 #include 3 #define PI 3.141592653589793238462643383 5 double piValue(int numAccuracy); int main(void) { HBBBBB 9 //develop your code here and call the piValue 10 11 12 return(0); 13 } 15 double piValue(int numAccuracy) { 16 //approximate the value of piusing the Madhava formula 17 18 } Develop mode Submit mode Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the vendbou