How does the logical AND (&&) operator behave when the first operand is false? 

  • It checks the second operand. 
  • It returns false immediately. 
  • It returns true immediately. 
  • It throws an exception.
In C++, the logical AND (&&) operator is "short-circuiting". This means if the first operand is false, it won't even check the second operand because the overall result will definitely be false. This behavior can be used for efficient coding practices.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *