0% found this document useful (0 votes)
33 views1 page

C++ Logical Operators

The document provides an overview of logical operators in C++, which are used to evaluate the truth of expressions. It describes three main operators: logical AND (&&), logical OR (||), and logical NOT (!), along with their functions and examples. The document indicates that further details on true and false values will be covered in a later chapter.

Uploaded by

Elsa Olivia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views1 page

C++ Logical Operators

The document provides an overview of logical operators in C++, which are used to evaluate the truth of expressions. It describes three main operators: logical AND (&&), logical OR (||), and logical NOT (!), along with their functions and examples. The document indicates that further details on true and false values will be covered in a later chapter.

Uploaded by

Elsa Olivia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

 Tutorials  Exercises  Get Certified  Services  Search...

HTML
 CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO [Link] C

C++ Logical Operators


❮ Previous Next ❯

Logical Operators
As with comparison operators, you can also test for true ( 1 ) or false ( 0 ) values
with logical operators.

Logical operators are used to determine the logic between variables or values:

Operator Name Description Example Try it

&& Logical Returns true if both x < 5 && x < Try it »


and statements are true 10

|| Logical or Returns true if one of the x < 5 || x < 4 Try it »


statements is true

! Logical Reverse the result, returns !(x < 5 && x < Try it »
not false if the result is true 10)

You will learn much more about true and false values in a later chapter.

You might also like