A computer science problem by Spock Weakhypercharge

//What value will this print out, rounded to the nearest hundredths?
void main ()
{
 int x=1;
 float kittens=0;
 while (x<600000000000)
 {
  if (x%2==1)
  {
   kittens=kittens+(1.0/(2*x-1));
  }
  else 
  {
   kittens=kittens-(1.0/(2*x-1));
  }
  x++;
 }
  kittens=4*kittens;
    printf("%f\n",kittens);
}
×

Problem Loading...

Note Loading...

Set Loading...