Here is my code:
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int x;
int y = pow(2, x);
cin>>x;
cout<< y;
system("pause");
return 0;
}
Why do I get a compile error? LNK1561 entry point must be defined
I am using Visual Studio Express.
You need to assign a value to x before it is used
int x;
int y = pow(2, x); // <--- what is the value of x here?
Try getting the value of x
from the input first.
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int x;
cin >> x;
int y = pow(2, x);
cout<< y;
system("pause");
return 0;
}