title: C++ requires a type specifier for all declarations
body: <p>I am getting the error "C++ requires a type specifier for all declarations" on my "const MAX = 10;" line. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>//A program that adds up the maximum of 10 numbers ( 1,2,3,4,5,6,7,8,9,10 )
  
  
  #include &lt;iostream&gt;
  #include &lt;cmath&gt;
  using namespace std;
  const MAX = 10; //the error is here!
  
  int main()
  {
  int sum, num;
  sum = 0;
  num = 1;
  
  do
  {
      sum = sum + num;
      num++;
  }
  
  while (num &lt;= MAX);
  {
      cout &lt;&lt; "Sum = ";
  }
  return 0;
  }
  </code></pre>