Order of operands for logical operators
The order of operands of logical operators &&, || are important in C/C++. In mathematics, logical AND, OR, etc... operations are commutative. The result will not change even if we swap RHS and LHS of the operator. In C/C++ (may be in other languages as well) even though these operators are commutative, their order is critical. For example