title: How to remove duplicate elements from random array I generated?
body: <p>So I have this code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main() {
  
      char a[200], b = 0;
      int x;
      x = 100 + rand() % 200;
      for (int i = 0; i &lt; x; i++) {
          a[i] = 'a' + rand() % 26;
      }
  
      for (int i = 0; i &lt; x; i++) {
          if (b % 10 == 0) { 
              printf("\n%c ", a[i]); 
              b = 0;
          }
          else {
              printf("%c ", a[i]);
          }
          b++;
      }
      printf("\n");
  
      return 0;
  
  }
  </code></pre>
  
  <p>Purpose is that I should generate random array of letters from 'a' to 'z' (which I've managed to do) and after that print new array without elements that repeat in first array. I've tried implementing code from <a href="http://www.studytonight.com/c/remove-duplicate-element-program.php" rel="nofollow noreferrer">here</a> for removing duplicate elements but it didn't worked in my code. </p>