bhadmanathan
Junior Member level 1
Same program but different output ?
Hi ,
int main()
{
char a=1;
printf("%d\n",a<<32);
printf("%d\n",1<<32);
return 0;
}
OUTPUT:
1
0
I am using 32 bit compiler. When i shift beyond the width (0:31) , what is actually happening.
Even though both the printf statements are meant to same, i am getting different output ?
Thanks in advance
Hi ,
int main()
{
char a=1;
printf("%d\n",a<<32);
printf("%d\n",1<<32);
return 0;
}
OUTPUT:
1
0
I am using 32 bit compiler. When i shift beyond the width (0:31) , what is actually happening.
Even though both the printf statements are meant to same, i am getting different output ?
Thanks in advance