dimanche 13 novembre 2016

C++ if statement multiple conditions

if(2 <= num <= 10)
    cout << "Yes" << endl;
else
    cout << "No" << endl;

I know the syntax for the if condition is wrong and && should be used to acquire the wanted result. My question is why does this code always gives Yes as the output?

Aucun commentaire:

Enregistrer un commentaire