Reading and Displaying Boolean Values as TRUE and FALSE in c++




This video tutorial explains how to read and display boolean values as true and false instead of  1 and 0 in c++ programming.
You are gonna learn  how to set/use boolalpha flag to make the io to interpret  boolean values as true and false in detail with example.

source code for this tutorial

#include <iostream>

using namespace std;

int main()
{
bool boolvalue;
cin >> boolalpha >> boolvalue;
cout << boolalpha << boolvalue;
return 0;
}