title: Expected a statement error while using else if
body: <p>I'm trying to see the output but it always returns the "expected a statement" error message. I would appreciate any help, thanks.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  #include "stdafx.h"
  
  using namespace std;
  
  int main() {
    int const n = 6;
  
    int A[n] = {1, -2, 3, -4, 5, -6}, i, p, x;
    int T[n] = {1, 3, 5};
    int U[n] = {-2, -4, -6};
  
    p = 1;
    x = 1;
  
    for (i = 0; i &lt; n; i++) {
      if (A[i] &lt; 0) p = p * U[i] * U[i];
      cout &lt;&lt; "Test" &lt;&lt; p &lt;&lt; "\n";
  
      else if (A[i] &gt; 0) {
        x = x * T[i] * T[i] * T[i];
  
        cout &lt;&lt; "Test2" &lt;&lt; X &lt;&lt; "\n";
      }
    }
    return 0
  }
  </code></pre>