title: Storing Odd and Even numbers in an Array
body: <p>We were tasked to make a program that accepts ONLY ten inputs from the user and then sort it into an Even or Odd Array.</p>
  
  <ol>
  <li>Accepts 10 inputs.</li>
  <li>Segregates to an Even or Odd Array.</li>
  <li>Print how many are in the Even/Odd Array.</li>
  <li>Print the numbers in each Array.</li>
  </ol>
  
  <p>This is the program I made:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main(){
  int even[10];
  int odd[10];
  int number;
  int numOdd = 0;
  int numEven = 0;
  int sizeOdd = 0;
  int sizeEven = 0;
  int count;
  
  printf("Input numbers:\n");
  for(count = 0; count &lt; 10; count++){
      scanf("%d", &amp;number);
      if (number %2 == 0){
          while (numEven &lt; 10){
              even[numEven++] = number;
              sizeEven++;
          }
      }
      else {
          while (numOdd &lt; 10){
              odd[numOdd++] = number;
              sizeOdd++;
          }
      }
  }
  
  printf("\n\nEven numbers(%d): ", sizeEven);
  for(number = 0; number &lt; numEven; number++){
      printf("%d, ", even[number]);
  }
  
  printf("\n\nOdd numbers(%d): ", sizeOdd);
  for(number = 0; number &lt; numOdd; number++){
      printf("%d, ", odd[number]);
  }
  
  system("pause");
  return 0;
   }
  </code></pre>
  
  <p>But my program just outputs the first numbers in the array and repeats it. Like, if I input 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, I get:</p>
  
  <p>Even numbers (10): 2, 2, 2, 2, 2
  Odd numbers (10): 1, 1, 1, 1, 1</p>
  
  <p>Am I wrong with everything/my logic in the program? Am I on the right track and I just have to tweak it a bit? Hope for help!</p>