title: Sieve for 8 digit primes
body: <p>I am not able to find prime numbers of 8 digits in spite of increasing size of array <code>a</code>. It is working for smaller numbers:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;math.h&gt;
  
  int main()
  {
      int n,a[100000],i,m,k;
      scanf("%d",&amp;n);
      for (i=2;i&lt;=n;i++)
          a[i]=1;
      m=(sqrt(n)+1);
      for (i=2;i&lt;=m;i++)
          if (a[i]==1)
              for (k=i*i;k&lt;=n;k+=i)
                  a[k]=0;
      for (i=0;i&lt;=n;i++)
          if (a[i]==1)
              printf("%d\t",i);
      return 0;
  }
  </code></pre>