AcornPublishing_essential-csharp-7e/EssentialCSharp-8.0/src/Chapter18/4.0/Listing18.08.LoopSynchronouslyCalculatingPiInSections.cs
namespace AddisonWesley.Michaelis.EssentialCSharp.Shared.Listing18_08
{
    using System;

    class Program
    {
        const int TotalDigits = 100;
        const int BatchSize = 10;

        public static void Main()
        {
          string pi = null;
          int iterations = TotalDigits / BatchSize;
          for (int i = 0; i < iterations; i++)
          {
              pi += PiCalculator.Calculate(
                  BatchSize, i * BatchSize);
          }

          Console.WriteLine(pi);
        }
    }
}