[Solved] Why does this output “geeksforgeeks”? [closed]


Why is cout << “geeks”; inside the if condition executed?

Because otherwise the computer won’t know whether it was “true” or “false”?

Given if (foo()), the function foo must be called; this extends to any expression in general, which must be evaluated before their “result” can be known (though note that sub-expressions may be skipped due to short-circuiting).

solved Why does this output “geeksforgeeks”? [closed]