 <p>you should pass reference or address of variable to scanf not just the variable</p> <pre><code>//if (scanf ("%f", guess) == 1) change if (scanf ("%f", &amp;guess) == 1) //if(scanf ("%f", number) == 1) change if(scanf ("%f", &amp;number) == 1) </code></pre>