error C4430?

//This adds all even numbers up 20
#include<iostream>
using namespace std;
main()
{
//Initializing Varibles
long max_x;
long x;
long sum;
// Defining Varibles
max_x=20;
x=1;
sum=0;

while (x!=max_x)
{
if(x%2==0)
{
sum+=x;
x+=x;
}
}
cout<<sum;
return 0;
}

Why is this giving me a this error:
"Error c4430:missing type specifier-int assumed. Note: C while loop example 2.4 ++ does not support default-int"
Yes because you did not explicitly state yor main function's return type.
Must be: int main()
Topic archived. No new replies allowed.