title: sieve of Eratosthenes output error
body: <p>i started learning C a couple of days back. I am stuck with this problem on finding the prime numbers using Sieve of Erathosthemes. The code compiles but does not give proper output.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;math.h&gt;
  #define size 100
  
  int main()
  {
         int n;
         printf("Enter the value of n\n");
         scanf_s("%d",&amp;n);
         int A[size],i;
         for(i=0;i&lt;n+1;i++)
         {
              A[i]=i;
         }
          A[1]=0;
          for(i=0;i&lt;sqrt((float)n);i++)
          {
              for(int j=0;j&lt;n+1;j++)
              {
                  if(A[j]%i==0)A[j]=0;
                  else A[j]=j;
              }
          }`
          for(i=0;i&lt;n+1;i++)
          {
              if(A[i]!=0)printf("%d\n",A[i]);
          }
      }
  </code></pre>