Ad
  • Custom User Avatar

    check the warnings generated by your code. also check this out:

    unsigned a = 5;
    int b = -1;
    printf("%u is %s than %d\n", a, (a > b) ? "greater" : "less", b);
    

    this is why you needed a cast.