HI,
I am confused of storing capacity in our primitivetypes.
I delcared like that way..
#include<stdio. h>
main()
{
int a=0xFFFFFFFF;
printf("The hex value:%x\n",a);
printf("The dec value :%d",a);
}
Ans is showing like that way:-
The hex value:FFFFFFFF
The Dec value:-1
1)**Why it is showing like that way in Decimal ?*******
2)--->But if i add this line(a=a+0x01;) in programme before those two
printfs then answer is :
The hex value:0
The Dec value:0
3)--->and if i add like this way :a=a+0x02;
Then answers are:
The hex value:1
The Dec value:1
I will be happy if someone help me to know these concept.
Thanks
chang
I am confused of storing capacity in our primitivetypes.
I delcared like that way..
#include<stdio. h>
main()
{
int a=0xFFFFFFFF;
printf("The hex value:%x\n",a);
printf("The dec value :%d",a);
}
Ans is showing like that way:-
The hex value:FFFFFFFF
The Dec value:-1
1)**Why it is showing like that way in Decimal ?*******
2)--->But if i add this line(a=a+0x01;) in programme before those two
printfs then answer is :
The hex value:0
The Dec value:0
3)--->and if i add like this way :a=a+0x02;
Then answers are:
The hex value:1
The Dec value:1
I will be happy if someone help me to know these concept.
Thanks
chang
Comment