title: Selection Sort Code with srand input
body: <p>My instructor put us in charge of compiling a code where we make a Selection Sort Code in C, like this one I found online,</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
     int array[100], n, c, d, position, swap;
  
     printf("Enter number of elements\n");
     scanf("%d", &amp;n);
  
     printf("Enter %d integers\n", n);
  
     for ( c = 0 ; c &lt; n ; c++ )
        scanf("%d", &amp;array[c]);
  
     for ( c = 0 ; c &lt; ( n - 1 ) ; c++ )
     {
        position = c;
  
        for ( d = c + 1 ; d &lt; n ; d++ )
        {
           if ( array[position] &gt; array[d] )
              position = d;
        }
        if ( position != c )
        {
           swap = array[c];
           array[c] = array[position];
           array[position] = swap;
        }
     }
  
     printf("Sorted list in ascending order:\n");
  
     for ( c = 0 ; c &lt; n ; c++ )
        printf("%d\n", array[c]);
  
     return 0;
  }
  </code></pre>
  
  <p>Instead of inputting an array of numbers, we have to use the <code>srand()</code> command to generate a random set of numbers.</p>
  
  <p>I have been at it for about 4 hours now and I just can't seem to get it.<br>
  Please I really need help with using <code>srand()</code> and <code>rand()</code></p>