N
nirmalr
Hi all,
int
main()
{
unsigned char j = 0;
j = ~j >> 1;
printf("%u\n", j);
return 0;
}
I am expecting that the above program will print "128" as output,
Because I am negating "j" and right shifting it once.
But When I run this program, I am getting "255" as output.
Can any of you explain the reason for this or please forward me to
correct FAQ.
Thanks,
Nirmal R.
int
main()
{
unsigned char j = 0;
j = ~j >> 1;
printf("%u\n", j);
return 0;
}
I am expecting that the above program will print "128" as output,
Because I am negating "j" and right shifting it once.
But When I run this program, I am getting "255" as output.
Can any of you explain the reason for this or please forward me to
correct FAQ.
Thanks,
Nirmal R.