Introduction to C++ Programming
Learn C++ in step-by-step lessons.
Boolean Expressions: true or false
Sometimes a programmer would like one statement, or group of statements to execute only if certain conditions are true. There may be a different statement, or group of statements that are to be executed when the condition is false. An expression that can be evaluated to true or false is called a Boolean expression. (Named after a mathematician named Boole who developed Boolean algebra.)
In C++, the number 0 (zero) is considered to be false, all other numbers are true.
Please study the material at each of the links below.
- Boolean Expressions
- Drill on Boolean expressions
- Logical operators: &&, ||
- Rats in a maze: A few problems to solve using && and ||
/videos/mousemaze.mp4
Glossary for boolean lessonFull Glossary