#include<stdio.h>
void main()
{
unsigned int i=65535;//assume that size of integer is 2 byte
printf("%d",i);
}
output=-1 //if size of integer is 2 byte
output=65535// if size of integer is 4 byte
can anyone explain me why it print -1 instead of 65535
according to me Size of interger is 2 byte i.e 16 bit . i=65535(Decimal value) Binary representation of 65535 is 1111111111111111. so it can accommodate 65535 easily