title: Is there any way to solve this math problem without additional variables?
body: <p>So I have to realize this type of algorithm:</p>
  
  <p><a href="https://i.stack.imgur.com/U9W3E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U9W3E.png" alt="P(x):=\prod_{i=0}^{n}\frac{(-1)^i}{x^i}"></a></p>
  
  <p><code>i</code> starts from <code>0</code> with the step of <code>1</code> and there has to be <code>n</code> iterations.
  Input is <code>x</code> and <code>n</code>. Output is <code>P</code> which is the product of this formula. So, is there any way to solve it without additional variables?</p>
  
  <pre><code>int main() {
  
      int x, exp = 1, n, i, o;
      float p = 1;
  
      printf("Input value of x: \n");
      scanf_s("%d", &amp;x);
      printf("Input value of n: \n");
      scanf_s("%d", &amp;n);
      for (i = 1; i &lt;= n - 1; i++) {
            if (i % 2 == 0)
                o = -1;
            else
                o = 1;
            exp = exp * x;
            p = p * ((-1*(float)o) / exp);    
      }
      printf("Requested number is: %f\n", p);
      return 0;
  }
  </code></pre>