title: How to display random numbers (and colours) for a Roulette Wheel?
body: <p>Have to create a Roulette Wheel in C for coursework, trying to generate random numbers and have the program state the colour of the random number it selects (e.g. chooses 3 and program gives an output saying the selected pocket is red). I've made a small program, which doesn't work too well. </p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int random_number(int min_num, int max_num);
  
  int main(void) {
  
      printf("Landed on pocket %d\n",random_number(0,36));
        return 0;
      }
  
      int random_number(int min_num, int max_num)
      {
          int result=0,low_num=0,hi_num=0;
          if(min_num&lt;max_num)
          {
              low_num=min_num;
              hi_num=max_num+1; // this is done to include max_num in output.
          }else{
              low_num=max_num+1;// this is done to include max_num in output.
              hi_num=min_num;
          }
          srand(time(NULL));
          result = (rand()%(hi_num-low_num))+low_num;
  
  
      scanf ("%d", &amp;result);
  
      if (result == 1 || 3 || 5 || 7 || 9 || 12 || 14 || 16 || 18|| 19 || 21 || 23 || 25 || 27 || 30 || 32 || 34 || 36) 
      {           
          printf (" Red \n");
  
      }    
      else
      {
          if(result == (2|| 4|| 6|| 8|| 10|| 11|| 13|| 15|| 17|| 20|| 22|| 24|| 26|| 28|| 29|| 31|| 33|| 35))
          printf (" Black ");
          }
  
          return result;
   }
  </code></pre>
  
  <p>I'm fairly new at programming and would appreciate any help :) </p>