title: Odd random number in range [1..99]
body: <p>I want to fill an array with odd random numbers in a range [1..99]. </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;time.h&gt;
  using namespace std;
  
  const int N = 100;
  int a[N];
  
  void print(){
      for (int i=0; i&lt;N; i++) 
          cout &lt;&lt; a[i] &lt;&lt; " ";
  }
  
  int main(){
      srand(time(NULL));
      int number;
      for (int i=0; i&lt;N; i++) {
          number=(rand()%100)+1;
          if (number%2!=0)
              a[i]=number;
      }
      print();
  }
  </code></pre>
  
  <p>When I use this code I receive:</p>
  
  <p>0 7 0 0 29 0 0 93 0 0 29 0 27 0 0 13 35 0 0 0 0 0 51 0 0 0 97 99 15 73             79 0 73 0 21 39 0 7 25 41 1 99 31 0 0 1 0 81 69 73 37 95 0 0 0 41 21 75 97 31 0 0 0 0 0 0 31 21 0 11 33 65 0 69 0 0 9 63 27 0 13 0 63 27 0 7 0 0 99 0 77 0 59 5 0 99 0 69 0 0 </p>
  
  <p>What is wrong with that? Why there are a lot of "0"?</p>