By the way, at your site, if you want to impress people better, don't put that PI equals approximately 22/7. It looks way too simple. Better say:
Approximately,
PI ~ 3,14159265.
More Precisely,
PI = and then give one of the exact formulas you can find, for example, in http://en.wikipedia.org/wiki/Pi
int F( int n , int a, int b )
{
int r=0;
int mid=(a+b)/2;
for( int i=0 ; i<n ; i+=2, mid++)
{
if( i<mid ) r++ ;
if( i<mid && i>a ) r-- ;
if( i==mid ) r=r/2 ;
if( i>mid || i<b ) r=sqrt(r) ;
}
return r ;
}