title: How can I print conditional statement in an array
body: <p>I am trying to identify the prime and composite value from an array. But in conditional statement, it prints only if value not else.</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      int a[5], i, j;
      for (i = 0; i &lt; 5; i++)
      {
          scanf(&quot;%d&quot;, &amp;a[i]);
      }
      for (i = 0; i &lt; 5; i++)
      {
          for (j = 2; j &lt;= a[i] / 2; j++)
          {
              if (a[i] % j == 0)
              {
                  printf(&quot;%d is not a prime number\n&quot;, a[i]);
                  break;
              }
              else
              {
                  printf(&quot;%d is a prime number\n&quot;, a[i]);
                  break;
              }
          }
      }
      return 0;
  }
  </code></pre>