title: Why does an error occur when I modulus the value in array?
body: <p>may i know what exactly have gone wrong in this code? cause the output of the even number is not what i expected if i input the value in the comment</p>
  <pre><code>//int number[10]={0, 2, 5, 8, -2, 0, 6, 4, 3, 1};
  int number[10], divided_number[10], total_odd_numbers, total_even_numbers, a;
  for(int i=0;i&lt;=9;i++){
      a=i+1;
      cout&lt;&lt;&quot;Number &quot;&lt;&lt;a&lt;&lt;&quot;: &quot;;
      cin&gt;&gt;number[i];
      
  }
  for(int i =0; i&lt;=9; i++){
      cout&lt;&lt;*(number+i)&lt;&lt;&quot;  &quot;;
  }
  cout&lt;&lt;endl;
  for(int i=0;i&lt;=9; i++){
      divided_number[i]=number[i]%2;
      if(divided_number[i]!=0){
          total_odd_numbers +=1;
      }
      else if (divided_number[i]==0){
          total_even_numbers++;
      }
  }
  for(int i=0;i&lt;=9; i++){
      cout&lt;&lt;*(divided_number+i)&lt;&lt;&quot;  &quot;;
  }
  cout&lt;&lt;&quot;\n Total odd number: &quot;&lt;&lt;total_odd_numbers&lt;&lt;endl;
  cout&lt;&lt;&quot;\n Total even number: &quot;&lt;&lt;total_even_numbers&lt;&lt;endl;
  </code></pre>