C++ Boolean Type Program

Boolean type returns 1 or 0. If the value if true it returns 1 else it returns 0. The boolean variable can have true or false.

#include<iostream>
using namespace std;
int main(){
	bool b1 = true;
	cout<<"The value of true is "<<b1<<endl;
	bool b2 = false;
	cout<<"The value of false is "<<b2<<endl;
	return 0;
}
output of the boolean program, C++ boolean type
output of the boolean program

Leave a Reply