static void Main(string[] args) { Console.WriteLine(PI(13)); Console.Read(); } static double PI(int max) { double pi=0; int sign = 1; for (int c = 1; c <= max; c += 2) { pi += sign * (1.0 / c); sign *= -1; } return 4 * pi; }
Pi = acos(-1.);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)