bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/C++/C++ Tutorial
C++•C++ Tutorial

C++ Boolean Data Types

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind C++ Boolean Data Types?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___ isCodingFun = true;
3Order

Put the learning moves in the order that makes the concept easiest to apply.

Boolean values are mostly used for conditional testing, which you will learn more about in a later chapter.
When the value is returned, true = 1 and false = 0 .
A boolean data type is declared with the bool keyword and can only take the values true or false .

Boolean Types

A boolean data type is declared with the bool keyword and can only take the values true or false .

When the value is returned, true = 1 and false = 0 .

Example

bool isCodingFun = true;
bool isFishTasty = false;
cout << isCodingFun;
// Outputs 1 (true) cout << isFishTasty;  // Outputs 0 (false)

Boolean values are mostly used for conditional testing, which you will learn more about in a later chapter.

Previous

C++ Numeric Data Types

Next

C++ Character Data Types