I ran this code:
#include <stdlib.h>
int main(){
unsigned int x = -1;
printf("%d\n", x);
}
And it still works but it shouldn't. Because some people say that "Unsigned variables cant handle negative numbers".
You need to use %u to print unsigned integers. As luck would have it, you are taking an integer (-1), converting to an unsigned int, and then treating that as an integer again (%d)
#include <stdlib.h>
int main(){
unsigned int x = -1;
printf("%u\n", x);
}