title: Finding duplicate numbers and print out the most duplicated first and the rest
body: <p>so far I have managed to find the duplicate numbers but i want to read in the inputs and determine if the there is any duplicated element in the list. If all values are unique print out "list has no duplicate values", otherwise print out the values that are duplicated as they appear from left to right in the list (each separated by a newline character). </p>
  
  <p>I need to print out the most duplicated number in the list followed by the second most duplicate value. How do I do this? I know I have to edit the if statement but I am not sure how.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdbool.h&gt;
  
  #define size 50
  
  int main(void)
  {       
     int i, j, n, du, dup[size];
     bool copy = false;
  
     scanf("%d", &amp;n);
  
     for (i=0; i&lt;n; i++) {
        scanf("%d", &amp;dup[i]);
     }
  
     for (i=0; i&lt;n; i++) {     
        for (j=0; j&lt;n; j++) {
           if (dup[i] == dup[j] &amp;&amp; j!=i) {
              copy = true;
           }
        }
     }
  
     if (copy) {
        printf("list has duplicate values");
     }
     else {
        printf("list has no duplicate values");
     }
     printf("\n");
  
     return 0;
  }
  </code></pre>