bool is a primitive data type, that is used to declare a variable whose value will be set as true (1) or false (0). To declare such a value, we use the bool keyword. We use bool in such situation, where the result may be true or false.
Example:
There is an operation validatePIN. This operation returns a value indicating either that the operation was successful in performing its task (i.e., a return value of true) or that it was not (i.e. a return value of false).
bool validatePIN (int); // is user-specified Pin correct?