fork download
#include 
#include 
#include 
#include 

using namespace std;

int main(void)
{
    int i;
    long double result;
    long double pi;
    int y=3;
    int loopcount=0;
    long double precision = 0;
    long double previous = 0;

    cout<<"Start\n";

    result=1-(pow(1,y)/y);

    do
    {
        y=y+2;
        result=result+(pow(1,y)/y);
        y=y+2;
        result=result-(pow(1,y)/y);

        pi=4*(result);
        precision=(pi*(pow(10,11))/10);

        loopcount++;

        if (floor(precision)==floor(previous))
            break;

        previous = precision;
    }
    while(true); //This is the problem!);

    cout<<"Final Arctan is:"<
				
				
				
				
				
				
			
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
Start
Final Arctan is:
0.78539640052495345225
Final Pi is:
3.1415856
Times looped:
70906