title: error: expected unqualified-id before 'switch'
body: <p>I'm making a code where the users input date, month, year and the program can identify if its a leap year or not but i ran into trouble with the error saying &quot;expected unqualified-id before 'switch' &quot;. What is happening with my code? I can't figure out the issue. this is the line im having problems with &quot;switch(Month)&quot;. can someone help me please.</p>
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include &lt;cmath&gt;
  using namespace std;
  // declaring
  int Day = 0;
  int Month = 0;
  int Year = 0;
  bool leapYear (int);
  int main(int argc, char *argv[])
  {
      // outputting messages to the user
      cout &lt;&lt; &quot;Lets check your dates shall we?&quot; &lt;&lt; endl;
      cout &lt;&lt; &quot;Please enter in a two(2) digit number for the month.&quot; &lt;&lt; endl;
      cin &gt;&gt; Month;
      cout &lt;&lt; &quot;Please enter in a two(2) digit number for the day.&quot; &lt;&lt; endl;
      cin &gt;&gt; Day;
      cout &lt;&lt; &quot;Please enter in a four(4) digit number for the year.&quot; &lt;&lt; endl;
      cin &gt;&gt; Year;
  
      system(&quot;PAUSE&quot;);
      return EXIT_SUCCESS;
  }
  switch(Month)
  {
         case 1:
              if (Day == 1 ... 31)
                 cout &lt;&lt; &quot;January&quot; &lt;&lt; Day &lt;&lt; &quot;th,&quot; &lt;&lt; Year &lt;&lt; &quot;,&quot; &lt;&lt; endl;
              break;
         case 2:
              if (Day == 1 ... 28)
                 cout &lt;&lt; &quot;February&quot; &lt;&lt; Day &lt;&lt; &quot;th,&quot; &lt;&lt; Year &lt;&lt; &quot;,&quot; &lt;&lt; endl;
              else if (Day == 29)
                 leapYear(Day);  
              break;
         case 3:
              if (Day == 1 ... 31)
                 cout &lt;&lt; &quot;March&quot; &lt;&lt; Day &lt;&lt; &quot;th,&quot; &lt;&lt; Year &lt;&lt; &quot;,&quot; &lt;&lt; endl;
              break;
         case 4:
              if (Day == 1 ... 30)
                 cout &lt;&lt; &quot;April&quot; &lt;&lt; Day &lt;&lt; &quot;th,&quot; &lt;&lt; Year &lt;&lt; &quot;,&quot; &lt;&lt; endl;
              break;
         case 5:
              if (Day == 1 ... 31)
                 cout &lt;&lt; &quot;May&quot; &lt;&lt; Day &lt;&lt; &quot;th,&quot; &lt;&lt; Year &lt;&lt; &quot;,&quot; &lt;&lt; endl;
              break;
         case 6:
              if (Day == 1 ... 30)
                 cout &lt;&lt; &quot;June&quot; &lt;&lt; Day &lt;&lt; &quot;th,&quot; &lt;&lt; Year &lt;&lt; &quot;,&quot; &lt;&lt; endl;
              break;
         case 7:
              if (Day == 1 ... 31)
                 cout &lt;&lt; &quot;July&quot; &lt;&lt; Day &lt;&lt; &quot;th,&quot; &lt;&lt; Year &lt;&lt; &quot;,&quot; &lt;&lt; endl;
              break;
         case 8:
              if (Day == 1 ... 31)
                 cout &lt;&lt; &quot;August&quot; &lt;&lt; Day &lt;&lt; &quot;th,&quot; &lt;&lt; Year &lt;&lt; &quot;,&quot; &lt;&lt; endl;
              break;
         case 9:
              if (Day == 1 ... 30)
                 cout &lt;&lt; &quot;September&quot; &lt;&lt; Day &lt;&lt; &quot;th,&quot; &lt;&lt; Year &lt;&lt; &quot;,&quot; &lt;&lt; endl;
              break;
         case 10:
              if (Day == 1 ... 31)
                 cout &lt;&lt; &quot;October&quot; &lt;&lt; Day &lt;&lt; &quot;th,&quot; &lt;&lt; Year &lt;&lt; &quot;,&quot; &lt;&lt; endl;
              break;
         case 11:
              if (Day == 1 ... 30)
                 cout &lt;&lt; &quot;November&quot; &lt;&lt; Day &lt;&lt; &quot;th,&quot; &lt;&lt; Year &lt;&lt; &quot;,&quot; &lt;&lt; endl;
              break;
         case 12:
              if (Day == 1 ... 31)
                 cout &lt;&lt; &quot;December&quot; &lt;&lt; Day &lt;&lt; &quot;th,&quot; &lt;&lt; Year &lt;&lt; &quot;,&quot; &lt;&lt; endl;
              break;
  }
  
  </code></pre>