Hello i have tried to understand the output of the following code in C but i dont get why x is x greater than y i.e why is x > y?
#include <stdio.h>
int main(){
short a = -2;
unsigned short b = -a;
int x = -2;
unsigned y = -x;
if(a<(unsigned short)b)
printf("a < b\t");
else
printf("a >= b\t");
if((unsigned)x<y)
printf("and x < y\n");
else
//my problem is here
printf("and x >= y\n");
}
output : a < b and x >= y