- Aug 17, 2005
- 790
- 0
- 0
So the goal of the program I am to write is: To write a program that finds a ratio of two small(less than 1000) integers that estiamtes PI to at least 0.00001%.
hints: use a double loop.
So far I got this:
#define PI 3.1415926535
int main(void) {
float i,j,r;
for(i=0; i<1000; i++);
for(j=0; i<1000;j++);
{
r=i/j;
}
system("PAUSE");
return 0;
}
But I really am not sure how I am suppose to bring in PI or really to go any further then what I just did. Please help guys. Thanks
hints: use a double loop.
So far I got this:
#define PI 3.1415926535
int main(void) {
float i,j,r;
for(i=0; i<1000; i++);
for(j=0; i<1000;j++);
{
r=i/j;
}
system("PAUSE");
return 0;
}
But I really am not sure how I am suppose to bring in PI or really to go any further then what I just did. Please help guys. Thanks