lundi 29 juin 2015

Placing a "!" before a condition statement


For example:

while (! ( (planet == "Mercury") || (planet == "Pluto") ) )
{
     <body>;
}

Would the above be the same as saying:

while ( (planet != "Mercury") || (planet != "Pluto") )
{
     <body>;
}

If not, what would it mean to place the NOT operation before the condition statement as shown in the first block of code?


Aucun commentaire:

Enregistrer un commentaire