Print prime numbers less than 100
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/453793/which-is-the-fastest-algorithm-to-find-prime-numbers">Which is the fastest algorithm to find prime numbers?</a>  </p>
</blockquote>



<p>is there any way to make this more optimize..   </p>

<pre><code>#include &lt;vector&gt;
    int main()
    {
        std::vector&lt;int&gt; primes;
        primes.push_back(2);
        for(int i=3; i &lt; 100; i++)
        {
            bool prime=true;
            for(int j=0;j&lt;primes.size() &amp;&amp; primes[j]*primes[j] &lt;= i;j++)
            {
                if(i % primes[j] == 0)
                {
                    prime=false;
                    break;
                }
            }
            if(prime) 
            {
                primes.push_back(i);
                cout &lt;&lt; i &lt;&lt; " ";
            }
        }

        return 0;
    }
</code></pre>
