machine specs
gcc version 3.4.3
SunOS 5.10 Generic_118833-24 sun4v sparc SUNW,Sun-Fire-T200
---------------------------
/* code */
unsigned int a=3;
a=a-4;
printf("%02d",a);
if (a<0)
printf("%02d",a);
/* end code */
output
-1
----------------------------
my question is; if a is an unsigned variable how is it storing a -ve value
secondly, if its storing the -ve value why is the check failing (a<0)
I should get -1 two times not once.