title: Take an array of numbers and then display only the distinct number
body: <p>In the below code I am taking an array to read 4 numbers and I need only to display the distinct number.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(){
      int ch[3];
      int s[3];
      int count = 0;
      int i;
      int j;
  
      for(i = 0; i &lt; 4; i++){
          scanf("%d", &amp;s[i]);
          for(i = 0; i &lt; 4; i++){
              ch[i] = s[i];
              printf("ch= %d", ch[j]);
          }
  
          if(ch[i] == s[i]){
              count = count + 1;
              printf("%d =", count);
          }
      }
  }
  </code></pre>
  
  <p>Somewhat I'm not getting the output, it is giving me a weird output. </p>
  
  <h2>Question:</h2>
  
  <p>What could be the cause of the strange output?</p>