Uneven results with Stdio.H Header in Cpp
<pre><code>#include &lt;iostream&gt;
#include "stdio.h"
using namespace std;

main()
{

unsigned short b,c,a=0xFFFF; // or unsigned char

cout&lt;&lt;(int)a&lt;&lt;endl;

scanf("%u",&amp;b); // %u or %d

printf("a is %d\n",a);

printf("%d\n",b);

}
</code></pre>

<p>Just have a look at this code..</p>

<p>a is initially given the value 65535.</p>

<p>It prints value of a as 65535</p>

<p>Then it reads in b(Any Input).</p>

<p>Then it is printing a as 0.</p>

<p>Then it prints value of b correctly.</p>

<p>Why is it so ?? </p>
