why is the value of the following expression false?
bool a = false;
bool b= true;
std::cout<< a || !b && !a || b;
and why does the value changes when adding parenthesis
bool a = false;
bool b= true;
std::cout<< (a || !b && !a || b);
Shouldn't the parenthesis be putted like this:
a || (!b && !a) || b
, and the result be false
or false
or true
equal true
?