C++ prime number generator is not working
<pre><code>#include &lt;iostream&gt;
using namespace std;

int checkIfPrime(int num) {
    for (int i = 1; i &lt; num; i++) {
        int result = num / i;
        if (num == result * i) {
                return 0;
        }
    }
}


int main() {
    int i = 3;
    while(1) {  
             int c = checkIfPrime(i);
             if (c != 0) {
                cout &lt;&lt; c &lt;&lt; "\n";
             }
             i = i + 2;
      }
}
</code></pre>

<p>Sorry about posting the wrong code! </p>

<p>When I run this, nothing happens.. Can someone tell me what I am doing wrong?</p>
