boolapha: true and false values to be input and output : cout boolalpha « Console « C++






boolapha: true and false values to be input and output

boolapha: true and false values to be input and output
#include <iostream>
using namespace std;
int main()
{
  bool b;
  b = true;
  cout << b << " " << boolalpha << b << endl;
  cout << "Enter a Boolean value: ";
  cin >> boolalpha >> b;
  cout << "Here is what you entered:  " << b;
  return 0;
}


           
       








Related examples in the same category

1.Demonstrate boolalpha format flag.Demonstrate boolalpha format flag.