title: Fastest way to calculate all the even squares from 1 to n?
body: <p>I did this in c :</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main (void)
  {
   int n,i;
  
   scanf("%d", &amp;n);
  
   for(i=2;i&lt;=n;i=i+2)
   {
     if((i*i)%2==0 &amp;&amp; (i*i)&lt;= n)
        printf("%d \n",(i*i));
   }
   return 0;
  }
  </code></pre>
  
  <p>What would be a better/faster approach to tackle this problem?</p>