mercredi 24 février 2016

Printf even though it shouldn't

I have this part of an if statement and I'm getting a weird output.

int x = 10;

if(1 < x < 5){
    printf("F\n");
}

Why does it print "F"? Logically isn't the if statement false because x is greater than 1 but not less than 5?

Aucun commentaire:

Enregistrer un commentaire