title: Fill array with the alphabet using rand function in C
body: <p>I'm writing an encode and a decode program, so I need to create an array of the alphabet using rand so it is shuffled. My code below results in duplication of letters. How can I get each of the 26 letters to appear using the rand function? 
  I did try creating an array of used characters, but that resulted in characters outside the range 'a' - 'z', mostly spaces.</p>
  
  <pre><code>int main(int argc, char *argv[]) {
      int key, currch, i;
      char plain[] = "abcdefghijklmnopqrstuvwxyz";
      char coded[26];
      key = atoi(argv[1]);
      srand((unsigned)key);
  
      for(i=0; i&lt;26; i++) {
              coded[i] = 'a' + rand() % 26;
      }
   // testing to see what is in the array
      i=0; 
      while(i&lt;26) {
              printf("%c ", coded[i]);
              i++;
      }
  }
  </code></pre>
  
  <p>The output when using 33 as the seed is</p>
  
  <pre><code>z h w p b i h x c q u m a v u v f u k u j j d s y g
  </code></pre>
  
  <p>As you can see, there are duplicates (u, v, j)</p>
  
  <p>Thanks for any feedback!</p>