title: C - Print all prime numbers from 1 to 100 using arrays
body: <p>OK so I got this challenge where I have to print all the primes from <code>1</code> to <code>100</code>... However there is an error in my code that I am unable to find. Here is how I thought the problem should be done:</p>
  <ul>
  <li>For any number from 3 to 100 check if there is any other number in the primes array that divides it. If there is the number is not prime. If there is not the number is prime and should be added to the array. Pretty simple, right ?
  However it is not working.</li>
  </ul>
  <p>Here is my code :</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      int Primes[50] = {0};
      int i, j, k;
  
      Primes[0] = 2;
      Primes[1] = 3;
      for (i = 3; i &lt; 101; i++) {
          for (j = 2; j &lt; 100; j++) {
              if (i % Primes[j] != 0 &amp;&amp; Primes[j] != 0) {
                  Primes[j] = i;
              }
          }
      }
      printf(&quot;Primes array : \n&quot;);
      for (k = 0; k &lt; 51; k++) {
          printf(&quot;%d &quot;, Primes[k]);
      }
      return 0;
  }
  </code></pre>