title: odd or even number using pointer in C
body: <p>I have an array, the elements inside this array should be assigned randomly
  then I create two more arrays one for odd and one for even numbers
  using pointers I want to put the odd numbers inside the odd array, and the even numbers in the even one.
  how can I assign it using pointers?</p>
  <p>I came up with this:</p>
  <pre><code>int main()
  {
      int array[10];
      int *arrayPtr = &amp;array;
  
      int arrayEven[10];
      int *pEven = &amp;arrayEven;
  
      int arrayOdd[10];
      int * pOdd = &amp;arrayOdd;
  
      int i, j;
  
      for(i=0; i&lt;10; i++)
          {
  
          array[i] =rand()%100 ;
  
  
  
  
          if(array[i] %2 ==0)
          {
              printf(&quot;%d\n&quot;, array[i]);
              printf(&quot;Even number&quot;);
          }
          else
          {
              printf(&quot;%d\n&quot;, array[i]);
              printf(&quot;Odd number&quot;);
  
          }
  
      }
  </code></pre>