Ok so i want to make a program that calculates pi. Ive done that already but it only gives me so many decimal places. I want it to give me tons. Im using Dev C++ if that helps too. Here's my code:
#include <iostream.h>
#include <math.h>
int main()
{
double pi = 0;
int elements;
cout << "How many???";
cin >> elements;
for (int n = 1; n <= elements; n++)
{
pi += (double) pow(-1, n+1)/(2*n-1);
}
pi *= 4;
cout << "Estimated PI value (" << elements << " elements): " << pi;
system("pause");
return 0;
}