C++ Code Example: if else statement on boolean expressions

Logical operators have different priorities and therefore are executed at different times.

The order is as follows:
Logical complements (!) are executed first,
logical conjunctions (&&) are executed next,
and logical disjunctions (||) are executed at the end.

#include <iostream>
using namespace std;

int main() {
    bool a = true, b = true, c = false;

    if ((a or b) and c) {
        cout << "True";
    } else {
        cout << "False";

    return 0;