title: expected primary-expression before '%' token & 'else' without a previous 'if'
body: <p>novice programmer here learning for my Associates in Computer Science
  I'm having a problem with my current assignment and I'm trying to figure out where my 2 syntax errors are. I've been looking at similar assignments that I've done but to no avail I can't find the problem I'm having.</p>
  <p>I'm getting the following errors on these 2 lines:</p>
  <blockquote>
  <p>'else' without a previous 'if' @ &quot;else if (num &gt;= 1 &amp;&amp; num &lt;= 50 &amp;&amp; num % 2 == 0) //check for EVEN number between 1 and 50&quot;</p>
  <p>expected primary-expression before '%' token @ &quot;else if (num &gt; 50 %% num &lt;= 100 &amp;&amp; num % 10 == 0) // Check for MULTIPLE OF 10 between 51 and 100&quot;</p>
  </blockquote>
  <pre><code>using namespace std;
  
  int main ()
  {
  
      cout &lt;&lt; &quot;Jon Grezda CS 12 Wednesday 6-8pm&quot; &lt;&lt; endl;
      cout &lt;&lt; &quot;Assignment #9&quot; &lt;&lt; endl;
  
      int num;
  //num - Number input
  
      cout &lt;&lt; &quot;Please enter a whole number between the numbers 1-100.&quot; &lt;&lt; endl;
      cin &gt;&gt; num;     //Is the number in the right range?
  
      if (num &lt; 1 || num &gt; 100) //INVALID Number, Terminate program
  
          cout &lt;&lt; &quot;INVALID NUMBER, rerun program and please try again&quot; &lt;&lt; endl;
      cout &lt;&lt; &quot;Program Terminated&quot;;
  
      else if (num &gt;= 1 &amp;&amp; num &lt;= 50 &amp;&amp; num % 2 == 0) //check for EVEN number between 1 and 50
  
          cout &lt;&lt; &quot;The number &quot; &lt;&lt; num &lt;&lt; &quot; is an EVEN number&quot;;
  
      else if (num &gt;= 1 &amp;&amp; num &lt;= 50 &amp;&amp; num % 2 == 1) //check for ODD number between 1 and 50
  
          cout &lt;&lt; &quot;The number &quot; &lt;&lt; num &lt;&lt; &quot; is an ODD number&quot;;
  
      else if (num &gt; 50 % % num &lt;= 100 &amp;&amp; num % 10 == 0) // Check for MULTIPLE OF 10 between 51 and 100
  
          cout &lt;&lt; &quot;The number &quot; &lt;&lt; num &lt;&lt; &quot;is A MULTIPLE OF 10&quot;;
  
      else // Check for NOT A MULTIPLE OF 10 between 51 and 100
          cout &lt;&lt; &quot;The number &quot; &lt;&lt; num &lt;&lt; &quot;is NOT A  MULTIPLE OF 10&quot;;
  
  }
  </code></pre>