|
|
Tutorials

Cpp

|
Topic |
How is "boolean" datatype used in C++?.
|
|
Explanation |
|
The "boolean" data type is used to represent boolean values that returns either "true" or "false". Usually
the values are returned as 0 or 1.
Example:
#include <iostream.h>
using namespace std;
void main()
{
int a=10;
int c=0;
bool b= (a
|
Result:
The Boolean Value is:: 0
In the above example, the a boolean value returned by the data type is "0" since the expression is false.
|
| Note |
C++ is one of the most used programming languages in the world. Also known as "C with Classes".
Hope you enjoy this tutorial. Do send your feedback or suggestions on this C++ tutorial. This is a copyright content.
|
|
|
|