title: I need help understanding the issue with this nested if else
body: <p>I'm trying to write a simple program to differentiate even and odd numbers and apply a function to them based upon their values, I try to run this and I get an "else without previous if" on both of my "else" statements</p>
  
  <p>I submitted this to my class help forum and they said to include my if statements with brackets, which I have done. (possibly incorrectly)</p>
  
  <pre><code>int output = 0;
  if (Input &lt; 0); 
  {
      cout &lt;&lt; "0" &lt;&lt; endl:
  } else 
  {
      if (Input % 2 == 0);
      {
          output = (Input / 2);
          cout &lt;&lt; output &lt;&lt; endl;
      }
  }
  else 
  {   if (output = (3 * Input) + 1);
      {
          cout &lt;&lt; output &lt;&lt; endl;
      }
  }
  </code></pre>
  
  <p>Here is the error:</p>
  
  <pre><code>error: ‘else’ without a previous ‘if’ on both of the else statements
  </code></pre>