Functionality of scanf function in c
<p>I would like to know how scanf function was working in this case.</p>

<pre><code>main()
{
    printf("%d\n",scanf("%d"));
}
</code></pre>

<p>output : </p>

<p>./a.out</p>

<p>5</p>

<p>1</p>

<p>Here the scanf is waiting for input I entered 5.</p>

<p>I can see that scanf is successful and returned 1.</p>

<p>I really didn't understand where the integer 5 is stored.</p>