Code running forever in C — what did I do wrong?
<p>I want to know why when running this code I get an infinite output. Here is the code:</p>

<pre><code>#include &lt;stdio.h&gt;

int main(){

    int num;
    printf(" enter a number\n");
    scanf(" %d", &amp;num);
    for( num = 0 ; num &lt;= 10 ; num+=num){
        printf(" %d",num);
    }

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