// Testing evaluation order of logical expressions #include #include using namespace std; bool f(); bool g(); bool h(); int main() { // just executing this expr for its side effects if (f() || (g() && h())); } bool f() { cout << "f got called" << endl; return true; } bool g() { cout << "g got called" << endl; return true; } bool h() { cout << "h got called" << endl; return true; } /* Output: f got called */