title: Finding highest prime number from set of input integers in C
body: <p>Though my code doesn't have errors, I am having difficulty understanding the weird output and mistakes in my logic. 
  My idea is to separate prime numbers from input and store them in an array &amp; then arrange them in a descending order. I have trouble identifying if the input doesn't have integer in them or if the input is less than specific number of inputs.Here I am taking 4 inputs.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main()
  { 
  
      int i,j,p[3],n[3], count = 0;
  
      printf("Enter 4 integers:");
      scanf("%d,%d,%d,%d",&amp;n[0],&amp;n[1],&amp;n[2],&amp;n[3]);
  
      if(scanf("%d,%d,%d,%d",&amp;n[0],&amp;n[1],&amp;n[2],&amp;n[3]) != 4);
          printf("enter only 4 inputs\n");
      if(scanf("%d,%d,%d,%d",&amp;n[1],&amp;n[2],&amp;n[3],&amp;n[4]) &lt; 4);
          printf("enter only integers\n");
  
  
      for(j=0;j&lt;4;j++)
      {
          for (i = 2; i &lt;= n[j] / 2; i++)
          {
              if (n[j] % i == 0) 
              {
              count++;
              break;
              }
              if (count == 0)
                  p[j] = n[j];
              else
                  p[j]=0;
  
          }
      }
      for(j=0;j&lt;4;j++)                          // to display prime array
      {
      printf("%d\n",p[j]);
      }
  
      if(p[0] == p[1] == p[2] == p[3] ==0 )
          printf("No prime number is present\n");
  
      for(i=1;i&lt;4;++i)                              // Loop to store largest number to p[0] 
          {
              if(p[0]&lt;p[i]) 
              p[0]=p[i];
          }
          printf("Largest element = %d",p[0]);
      return 0;
  }
  </code></pre>