Hi guys, first post here. I am going to tell you that this is my upcoming lab assignment for tomorrow. I am simply trying it on my own first. We are just getting into c++ so I am a bit lost on debugging. I am also taking Java at the same time so the cross between is kinda strange. I am to calculate PI using (pi = 4 - 4/3 + 4/5 - 4/7 + ...). I wrote the following code and it won't build. The error I get is : error LNK2001: unresolved external symbol _WinMainCRTStartup. I am not to the point where I understand what this means. Any help is greatly appreciated. Here is my code thus far:
#include <iostream>
using namespace std;
int main()
{
int denominator = 3;
int terms = 30000;
double mypi = 4.0;
bool cond = true;
for ( int i = 1; i <= terms; i++ )
{
if (cond)
{
mypi = mypi - ( 4.0 / denominator );
}
else
{
mypi = mypi + ( 4.0 / denominator );
}
cond = !cond;
denominator = denominator + 2;
if ((i % 30) == 0)
{
cout << i << << mypi << endl;
}
}
return 0;
}