I want to know what is the reason of the output of the following codes:
unsigned short a=10,aa=-1;
if(a>-1)
printf("surprise");
else
printf(" No surprise");
This gives output "Surprise"
unsigned int a=10,aa=-1;
if(a>-1)
printf("surprise");
else
printf("No surprise");
This gives output "No Surprise"
and
unsigned short a=10,aa=-1;
if(a>aa)
printf("surprise");
else
printf("No surprise");
This gives the output "No Surprise"