title: Openmp Reduction for operator "-"
body: <pre><code>int main()
  {
      int a=0;
      omp_set_num_threads(2);
      #pragma omp parallel reduction(+ : a)
      {
          a = omp_get_thread_num()+1;
      }
      std::cout &lt;&lt; "Output:" &lt;&lt; a;
      return 1;
  }
  </code></pre>
  
  <p>I am getting wrong output using openmp reduction... For the following code, reduction(+) gives the output of sum of threadnum(), but when i mention reduction (-), it gives the same output... I am getting output as 3 for "+" and  "-".</p>