c++ using bool code example Example: how to initialize a boolean in c++ bool b1 = true; // declaring a boolean variable with true value